After R-4.4.0 update `colformat_md()` and `as_paragraph_md()` ignores spaces, causes `flextable::footnote()` to break
Closed this issue · 3 comments
ErwinTATP commented
After updating to R-4.4.0, the colformat_md()
and as_paragraph_md()
functions start to ignore the spaces between the words:
if (rmarkdown::pandoc_available("2.0.6")) {
library(flextable)
ft <- flextable(
data.frame(
x = c("**foo** bar", "***baz***", "*qux*"),
stringsAsFactors = FALSE
)
) %>%
ftExtra::colformat_md(
part = "all"
) %>%
set_caption(
caption = ftExtra::as_paragraph_md("This is a **caption**"),
style = "caption"
)
}
as can be seen in the following output:
Additionally, if I use as_paragraph_md()
in footnote()
:
if (rmarkdown::pandoc_available("2.0.6")) {
library(flextable)
ft <- flextable(
data.frame(
x = c("**foo** bar", "***baz***", "*qux*"),
stringsAsFactors = FALSE
)
) %>%
ftExtra::colformat_md(
part = "all"
) %>%
set_caption(
caption = ftExtra::as_paragraph_md("This is a **caption**"),
style = "caption"
) %>%
footnote(
i = 1, j = 1,
value = ftExtra::as_paragraph_md("**footnote**"),
ref_symbols = "*",
part = "header", inline = TRUE
)
}
the function would return the following error, no matter if the paragraph
contains spaces or not:
Error in match.names(clabs, names(xi)) :
names do not match previous names
Below are my sessionInfo()
:
- Session info --------------------------------------------------------------------------------------------
setting value
version R version 4.4.0 (2024-04-24 ucrt)
os Windows 11 x64 (build 22631)
system x86_64, mingw32
ui RTerm
language (EN)
collate English_United Kingdom.1252
ctype English_United Kingdom.1252
tz Asia/Hong_Kong
date 2024-05-02
pandoc 2.14.2 @ C:/PROGRA~1/Pandoc/ (via rmarkdown)
- Packages ------------------------------------------------------------------------------------------------
package * version date (UTC) lib source
askpass 1.2.0 2023-09-03 [1] CRAN (R 4.3.1)
cli 3.6.2 2023-12-11 [1] CRAN (R 4.3.3)
clipr * 0.8.0 2022-02-22 [1] CRAN (R 4.4.0)
colorspace 2.1-0 2023-01-23 [1] CRAN (R 4.4.0)
crayon 1.5.2 2022-09-29 [1] CRAN (R 4.3.0)
crul 1.4.2 2024-04-09 [1] CRAN (R 4.3.3)
curl 5.2.1 2024-03-01 [1] CRAN (R 4.3.3)
data.table 1.15.4 2024-03-30 [1] CRAN (R 4.3.3)
digest 0.6.35 2024-03-11 [1] CRAN (R 4.3.3)
dplyr * 1.1.4 2023-11-17 [1] CRAN (R 4.3.2)
evaluate 0.23 2023-11-01 [1] CRAN (R 4.3.2)
fansi 1.0.6 2023-12-08 [1] CRAN (R 4.3.2)
fastmap 1.1.1 2023-02-24 [1] CRAN (R 4.3.0)
flextable * 0.9.5 2024-03-06 [1] CRAN (R 4.3.3)
fontBitstreamVera 0.1.1 2017-02-01 [1] CRAN (R 4.3.0)
fontLiberation 0.1.0 2016-10-15 [1] CRAN (R 4.3.0)
fontquiver 0.2.1 2017-02-01 [1] CRAN (R 4.3.0)
forcats * 1.0.0 2023-01-29 [1] CRAN (R 4.4.0)
ftExtra 0.6.3 2024-04-02 [1] CRAN (R 4.3.3)
gdtools 0.3.7 2024-03-05 [1] CRAN (R 4.3.3)
generics 0.1.3 2022-07-05 [1] CRAN (R 4.3.0)
gfonts 0.2.0 2023-01-08 [1] CRAN (R 4.3.0)
ggplot2 * 3.5.1 2024-04-23 [1] CRAN (R 4.4.0)
glue 1.7.0 2024-01-09 [1] CRAN (R 4.4.0)
gtable 0.3.5 2024-04-22 [1] CRAN (R 4.4.0)
hms 1.1.3 2023-03-21 [1] CRAN (R 4.4.0)
htmltools 0.5.8.1 2024-04-04 [1] CRAN (R 4.3.3)
httpcode 0.3.0 2020-04-10 [1] CRAN (R 4.3.0)
httpuv 1.6.15 2024-03-26 [1] CRAN (R 4.3.3)
jsonlite 1.8.8 2023-12-04 [1] CRAN (R 4.3.2)
knitr 1.46 2024-04-06 [1] CRAN (R 4.3.3)
later 1.3.2 2023-12-06 [1] CRAN (R 4.3.2)
lifecycle 1.0.4 2023-11-07 [1] CRAN (R 4.3.2)
lubridate * 1.9.3 2023-09-27 [1] CRAN (R 4.4.0)
magrittr 2.0.3 2022-03-30 [1] CRAN (R 4.3.0)
mime 0.12 2021-09-28 [1] CRAN (R 4.3.0)
munsell 0.5.1 2024-04-01 [1] CRAN (R 4.4.0)
officer 0.6.5 2024-02-24 [1] CRAN (R 4.3.2)
openssl 2.1.2 2024-04-21 [1] CRAN (R 4.4.0)
pillar 1.9.0 2023-03-22 [1] CRAN (R 4.3.0)
pkgconfig 2.0.3 2019-09-22 [1] CRAN (R 4.3.0)
promises 1.3.0 2024-04-05 [1] CRAN (R 4.3.3)
purrr * 1.0.2 2023-08-10 [1] CRAN (R 4.3.1)
R6 2.5.1 2021-08-19 [1] CRAN (R 4.3.0)
ragg 1.3.0 2024-03-13 [1] CRAN (R 4.3.3)
Rcpp 1.0.12 2024-01-09 [1] CRAN (R 4.3.2)
readr * 2.1.5 2024-01-10 [1] CRAN (R 4.4.0)
rlang 1.1.3 2024-01-10 [1] CRAN (R 4.4.0)
rmarkdown 2.26 2024-03-05 [1] CRAN (R 4.3.3)
scales 1.3.0 2023-11-28 [1] CRAN (R 4.4.0)
sessioninfo 1.2.2 2021-12-06 [1] CRAN (R 4.4.0)
shiny 1.8.1.1 2024-04-02 [1] CRAN (R 4.3.3)
stringi 1.8.3 2023-12-11 [1] CRAN (R 4.3.2)
stringr * 1.5.1 2023-11-14 [1] CRAN (R 4.3.2)
systemfonts 1.0.6 2024-03-07 [1] CRAN (R 4.3.3)
textshaping 0.3.7 2023-10-09 [1] CRAN (R 4.3.2)
tibble * 3.2.1 2023-03-20 [1] CRAN (R 4.3.0)
tidyr * 1.3.1 2024-01-24 [1] CRAN (R 4.3.2)
tidyselect 1.2.1 2024-03-11 [1] CRAN (R 4.3.3)
tidyverse * 2.0.0 2023-02-22 [1] CRAN (R 4.4.0)
timechange 0.3.0 2024-01-18 [1] CRAN (R 4.4.0)
tzdb 0.4.0 2023-05-12 [1] CRAN (R 4.4.0)
utf8 1.2.4 2023-10-22 [1] CRAN (R 4.3.2)
uuid 1.2-0 2024-01-14 [1] CRAN (R 4.3.2)
vctrs 0.6.5 2023-12-01 [1] CRAN (R 4.3.2)
withr 3.0.0 2024-01-16 [1] CRAN (R 4.3.2)
xfun 0.43 2024-03-25 [1] CRAN (R 4.3.3)
xml2 1.3.6 2023-12-04 [1] CRAN (R 4.3.2)
xtable 1.8-4 2019-04-21 [1] CRAN (R 4.3.0)
zip 2.3.1 2024-01-27 [1] CRAN (R 4.3.2)
[1] C:/Program Files/R/R-4.4.0/library
-----------------------------------------------------------------------------------------------------------
atusy commented
Thank you for the report. I opened PR #106 to fix this.
Would you give a try with pak::pak('atusy/ftExtra#106)
?
ErwinTATP commented
Seems to be fixed so far. Thanks!
atusy commented
Great!