File tree Expand file tree Collapse file tree 1 file changed +5
-4
lines changed Expand file tree Collapse file tree 1 file changed +5
-4
lines changed Original file line number Diff line number Diff line change @@ -212,12 +212,13 @@ Reporter <- R6::R6Class( # nolint: object_name_linter.
212212 if (idx != length(cards )) blocks <- append(blocks , sep )
213213 next # Easier to remove when ReportCard is fully deprecated
214214 }
215- card_with_title <- if (length(metadata(card , " title" )) > 0 ) {
216- c(report_document(sprintf(" # %s" , metadata(card , " title" ))), card )
215+ title <- trimws(metadata(card , " title" ))
216+ card_title <- if (length(title ) > 0 && nzchar(title )) {
217+ report_document(sprintf(" # %s" , title ))
217218 } else {
218- card
219+ report_document(sprintf( " # _Unnamed Card (%d)_ " , idx ))
219220 }
220-
221+ card_with_title <- c( card_title , card )
221222 blocks <- append(blocks , unclass(card_with_title ))
222223 if (idx != length(cards )) blocks <- append(blocks , trimws(sep ))
223224 }
You can’t perform that action at this time.
0 commit comments