diff --git a/DESCRIPTION b/DESCRIPTION index 89770b47b..7f3e4c316 100644 --- a/DESCRIPTION +++ b/DESCRIPTION @@ -76,4 +76,4 @@ Config/usethis/last-upkeep: 2025-09-07 Encoding: UTF-8 Roxygen: list(markdown = TRUE) RoxygenNote: 7.3.3 -SystemRequirements: pandoc +SystemRequirements: pandoc (>= 2.10.1) diff --git a/NEWS.md b/NEWS.md index a23a28190..e5087ea93 100644 --- a/NEWS.md +++ b/NEWS.md @@ -2,6 +2,8 @@ # pkgdown 2.2.0 +* Make `build_llm_docs()` more robust to the use of old Pandoc (@nanxstats, @galachad, #2952, #2954) + ## Lifecycle changes * `autolink_html()` deprecated in 1.6.0 and `preview_page()` have been removed. diff --git a/R/build-llm.R b/R/build-llm.R index 053cbc0a8..15284e639 100644 --- a/R/build-llm.R +++ b/R/build-llm.R @@ -76,11 +76,17 @@ convert_md <- function(src_path, dst_path, url = NULL) { xml2::write_html(main_html, path, format = FALSE) on.exit(file_delete(path), add = TRUE) + if (rmarkdown::pandoc_available("2.10.1")) { + to <- "gfm+definition_lists-raw_html" + } else { + to <- "gfm-raw_html" + } + rmarkdown::pandoc_convert( input = path, output = dst_path, from = "html", - to = "gfm+definition_lists-raw_html", + to = to, ) }