Skip to content

Commit 7398fea

Browse files
authored
Merge pull request #556 from renkun-ken/pandoc-version
Use lua-filter when pandoc_version >= 2.11
2 parents 528514d + 957d8e9 commit 7398fea

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

R/utils.R

+3-3
Original file line numberDiff line numberDiff line change
@@ -727,9 +727,9 @@ html_to_markdown <- function(html) {
727727
logger$info("Converting html to markdown using", html_file, md_file)
728728
stringi::stri_write_lines(html, html_file)
729729
result <- tryCatch({
730-
pandoc2 <- rmarkdown::pandoc_version() >= "2.0"
731-
format <- if (pandoc2) "gfm" else "markdown_github"
732-
options <- if (pandoc2) c("--lua-filter", system.file(package = "languageserver", "lua/html-to-markdown.lua"))
730+
pandoc_version <- rmarkdown::pandoc_version()
731+
format <- if (pandoc_version >= "2.0") "gfm" else "markdown_github"
732+
options <- if (pandoc_version >= "2.11") c("--lua-filter", system.file(package = "languageserver", "lua/html-to-markdown.lua"))
733733
rmarkdown::pandoc_convert(html_file, to = format, output = md_file, options = options)
734734
paste0(stringi::stri_read_lines(md_file, encoding = "utf-8"), collapse = "\n")
735735
}, error = function(e) {

0 commit comments

Comments
 (0)