diff --git a/DESCRIPTION b/DESCRIPTION index 8a0849d..d744d6a 100644 --- a/DESCRIPTION +++ b/DESCRIPTION @@ -1,6 +1,6 @@ Package: ftExtra Title: Extensions for 'Flextable' -Version: 0.3.0 +Version: 0.3.0.9999 Date: 2022-01-04 Authors@R: c(person(given = "Atsushi", diff --git a/NEWS.md b/NEWS.md index 709ada0..cc73575 100644 --- a/NEWS.md +++ b/NEWS.md @@ -1,3 +1,7 @@ +# ftExtra 0.3.0.9999 + +* `as_paragraph_md` supports empty string, `""`, as an input (#68). + # ftExtra 0.3.0 ## New features diff --git a/R/as-paragraph-md.R b/R/as-paragraph-md.R index 1a9f6cc..49bdbb3 100644 --- a/R/as-paragraph-md.R +++ b/R/as-paragraph-md.R @@ -45,7 +45,7 @@ organize <- function(md_df, construct_chunk <- function(x, auto_color_link = "blue") { flextable::chunk_dataframe( - txt = x$txt, + txt = x$txt %||% "", # x can be empty list when input is empty string italic = x$Emph %||% NA, bold = x$Strong %||% NA, url = x$Link %||% NA_character_, @@ -126,6 +126,7 @@ as_paragraph_md <- function(x, organize(md_df, auto_color_link, .footnote_options) } else { lapply(x, function(x) { + if (x == "") return(construct_chunk(list())) y <- x %>% md2df(pandoc_args = pandoc_args, .from = .from, .check = TRUE) %>% solve_footnote(.footnote_options, auto_color_link) %>%