From 93d91c3d2ec9c40336ef71d97638906e2143141f Mon Sep 17 00:00:00 2001 From: christophe dervieux Date: Tue, 20 Jul 2021 09:27:31 +0200 Subject: [PATCH 1/3] deactivate extension about yaml metadata block for pandoc 2.13+ --- R/reprex_document.R | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/R/reprex_document.R b/R/reprex_document.R index 9d5a9910..16740c58 100644 --- a/R/reprex_document.R +++ b/R/reprex_document.R @@ -116,7 +116,7 @@ reprex_document <- function(venue = c("gh", "r", "rtf", "html", "slack", "so", " opts_chunk = opts_chunk ), pandoc = rmarkdown::pandoc_options( - to = "gfm", + to = paste0("gfm", if (rmarkdown::pandoc_available("2.13")) "-yaml_metadata_block"), from = rmarkdown::from_rmarkdown(implicit_figures = FALSE), ext = ".md", args = pandoc_args From 27695d30432f310d5f1b5824a1adcdb5675d746a Mon Sep 17 00:00:00 2001 From: Jenny Bryan Date: Wed, 21 Jul 2021 11:46:41 -0700 Subject: [PATCH 2/3] Leave an explanatory comment --- R/reprex_document.R | 1 + 1 file changed, 1 insertion(+) diff --git a/R/reprex_document.R b/R/reprex_document.R index 16740c58..b61f6066 100644 --- a/R/reprex_document.R +++ b/R/reprex_document.R @@ -116,6 +116,7 @@ reprex_document <- function(venue = c("gh", "r", "rtf", "html", "slack", "so", " opts_chunk = opts_chunk ), pandoc = rmarkdown::pandoc_options( + # https://github.com/tidyverse/reprex/issues/375 to = paste0("gfm", if (rmarkdown::pandoc_available("2.13")) "-yaml_metadata_block"), from = rmarkdown::from_rmarkdown(implicit_figures = FALSE), ext = ".md", From 75affdeb71bec09f6b239eb08c9b3a16cba4d761 Mon Sep 17 00:00:00 2001 From: Jenny Bryan Date: Wed, 21 Jul 2021 11:48:25 -0700 Subject: [PATCH 3/3] Add NEWS bullet --- NEWS.md | 2 ++ 1 file changed, 2 insertions(+) diff --git a/NEWS.md b/NEWS.md index 00beb188..ba01c182 100644 --- a/NEWS.md +++ b/NEWS.md @@ -1,5 +1,7 @@ # reprex (development version) +`reprex_document()` has been adjusted for compatibility with changes introduced in Pandoc 2.13 around YAML headers (#375, #383 @cderv). + `reprex_rtf()` (and the unexported `prex_rtf()`) work again. One of the filepaths involved in the highlight call was borked, but now it's not (#379).