diff --git a/DESCRIPTION b/DESCRIPTION index 8e1b6839ca..3b09fa405f 100644 --- a/DESCRIPTION +++ b/DESCRIPTION @@ -1,7 +1,7 @@ Package: rmarkdown Type: Package Title: Dynamic Documents for R -Version: 2.6.4 +Version: 2.6.5 Authors@R: c( person("JJ", "Allaire", role = "aut", email = "jj@rstudio.com"), person("Yihui", "Xie", role = c("aut", "cre"), email = "xie@yihui.name", comment = c(ORCID = "0000-0003-0645-5666")), diff --git a/NEWS.md b/NEWS.md index 827ef6beda..a62939d193 100644 --- a/NEWS.md +++ b/NEWS.md @@ -9,6 +9,9 @@ rmarkdown 2.7 - Automatically exclude renv directory for `render_site()` (thanks, @jmbuhr, #1996) +- Do not force `options(htmltools.preserve.raw = TRUE)` when this option has been set, otherwise it is impossible for other packages to turn this option off, e.g., yihui/xaringan#293. + + rmarkdown 2.6 ================================================================================ @@ -48,6 +51,7 @@ rmarkdown 2.6 - Fix Fontawesome 5 icons in navbar by correctly handling new prefix as `fa` has been deprecated in favor of `fas` or `fab` (#1967) + rmarkdown 2.5 ================================================================================ diff --git a/R/render.R b/R/render.R index e7a123915a..d3645b4f90 100644 --- a/R/render.R +++ b/R/render.R @@ -585,14 +585,13 @@ render <- function(input, templates <- knitr::opts_template$get() on.exit(knitr::opts_template$restore(templates), add = TRUE) - # specify that htmltools::htmlPreserve should use the pandoc raw - # attribute (e.g. ```{=html}) rather than preservation tokens when - # pandoc >= v2.0. Note that this option will have the intended effect - # only for versions of htmltools >= 0.5.1. + # specify that htmltools::htmlPreserve() should use the Pandoc raw attribute + # by default (e.g. ```{=html}) rather than preservation tokens when pandoc + # >= v2.0. Note that this option will have the intended effect only for + # versions of htmltools >= 0.5.1. if (pandoc2.0() && packageVersion("htmltools") >= "0.5.1") { - prev <- getOption("htmltools.preserve.raw", default = NA) - options(htmltools.preserve.raw = TRUE) - if (!is.na(prev)) { + if (is.null(prev <- getOption("htmltools.preserve.raw"))) { + options(htmltools.preserve.raw = TRUE) on.exit(options(htmltools.preserve.raw = prev), add = TRUE) } }