same issue now for pandoc 2.7.3! will you fix it?
_Originally posted by @andreaphsz in https://github.com/rstudio/pagedown/pull/19#issuecomment-505820690_
---
title: "A Multi-page HTML Document"
author: "Andrea Cantieni"
date: "`r Sys.Date()`"
output:
pagedown::html_paged:
toc: true
self_contained: false
links-to-footnotes: true
---
See [pagedown]( https://pagedown.rbind.io) for the full documentation.
R> rmarkdown::render("pagedown_bug.Rmd")
md5-87a5981867c56aefb8dc3707dc688405
Error running filter /Library/Frameworks/R.framework/Versions/3.5/Resources/library/pagedown/resources/lua/uri-to-fn.lua:
...5/Resources/library/pagedown/resources/lua/uri-to-fn.lua:7: attempt to index a HsLua Version value (local 'pandocVersion')
stack traceback:
...5/Resources/library/pagedown/resources/lua/uri-to-fn.lua:7: in upvalue 'pandocAvailable'
...5/Resources/library/pagedown/resources/lua/uri-to-fn.lua:35: in function <...5/Resources/library/pagedown/resources/lua/uri-to-fn.lua:22>
Error: pandoc document conversion failed with error 83
Thank you very much for the report and the traceback! This is extremely useful!
I haven't tested Pandoc 2.7.3 yet.
Having read the release note for pandoc 2.7.3, I think this is related to this evolution:
Version specifiers like PANDOC_VERSION and PANDOC_API_VERSION are turned into Version objects. The objects simplify version-appropriate comparisons while maintaining backward-compatibility. A function pandoc.types.Version is added as part of the newly introduced module pandoc.types, allowing users to create version objects in scripts.
It seems that Pandoc 2.7.3 broke this part of the uri-to-fn.lua filter:
https://github.com/rstudio/pagedown/blob/52db785c9e57c9f03cb294b4ca1f859b675884e6/inst/resources/lua/uri-to-fn.lua#L3-L15
I've fixed this issue through https://github.com/rstudio/pagedown/commit/1f062d49da705d0b0750e0389f7cd4d500f6ef71.
In Pandoc < 2.7.3, the global variable PANDOC_VERSION is of type table (in lua).
Since Pandoc 2.7.3, this variable is of type HsLua Version.
Using a shallow copy of PANDOC_VERSION solves the bug.
Thanks again for the bug report, @andreaphsz !
In order to use the patched version of pagedown, please install the development version with:
remotes::install_github('rstudio/pagedown')
Works! Thank you for the super fast fix!
You're welcome! I was able to fix it quickly because your bug report was clear enough.