From caf2b6cf41e56a1dd43a84a375ac2bf0cde7d76d Mon Sep 17 00:00:00 2001 From: Richard Iannone Date: Tue, 3 Oct 2023 17:52:27 -0400 Subject: [PATCH 1/3] Add gt-processed md to content of span --- R/utils.R | 18 +++++++++++++++++- 1 file changed, 17 insertions(+), 1 deletion(-) diff --git a/R/utils.R b/R/utils.R index 32504f8cd0..9596b6813e 100644 --- a/R/utils.R +++ b/R/utils.R @@ -757,8 +757,24 @@ md_to_html <- function(x, md_engine) { non_na_x <- x[!is.na(x)] + non_na_x_processed <- + vapply( + as.character(x[!is.na(x)]), + FUN.VALUE = character(1), + USE.NAMES = FALSE, + FUN = function(x) { + md_engine_fn[[1]](text = x) + } + ) + non_na_x <- tidy_gsub(non_na_x, "^", "") + non_na_x <- tidy_gsub(non_na_x, "$", "\">") + + non_na_x <- + paste0( + non_na_x, "
", + non_na_x_processed, "
" + ) #nocov end } From 1761d71207f700f8fff918f959ad19fcdaee834d Mon Sep 17 00:00:00 2001 From: Richard Iannone Date: Thu, 5 Oct 2023 14:24:29 -0400 Subject: [PATCH 2/3] Use a div instead of span to pass HTML validation --- R/utils.R | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/R/utils.R b/R/utils.R index 9596b6813e..c113a6a489 100644 --- a/R/utils.R +++ b/R/utils.R @@ -767,13 +767,13 @@ md_to_html <- function(x, md_engine) { } ) - non_na_x <- tidy_gsub(non_na_x, "^", "") non_na_x <- paste0( non_na_x, "
", - non_na_x_processed, "
" + non_na_x_processed, "" ) #nocov end From dae0e4786c842750b1d74b16771a3a8a064a356b Mon Sep 17 00:00:00 2001 From: Richard Iannone Date: Thu, 5 Oct 2023 14:28:57 -0400 Subject: [PATCH 3/3] Update NEWS.md --- NEWS.md | 2 ++ 1 file changed, 2 insertions(+) diff --git a/NEWS.md b/NEWS.md index 61eee87879..d23c2b3b75 100644 --- a/NEWS.md +++ b/NEWS.md @@ -92,6 +92,8 @@ * Fixed a LaTeX bug where some characters following a `\midrule` would corrupt the table (#145, #391). (#1390) +* Provided a rendering fallback for HTML tables rendered in Quarto where the combination of `fmt_markdown()` and `tab_options(quarto.disable_processing = TRUE)` would incorrectly result in empty cells. (#1455) + * A issue associated with a lack of HTML formatting within interactive tables has been fixed (#1299, #1370, #1384). (#1388) * Many user-facing error messages have been enhanced using the latest features from the **cli** package. (#1337, thanks @olivroy!)