You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
This was first reported in tidyverse/reprex#375 and needs to be handled in rmarkdown directly.
Pandoc 2.13 added support for yaml_metadata_block to commonmark in addition to markdown: jgm/pandoc@c389211
This impact gfm and commonmark_x for which it is activated by default. The change for gfm is a breaking change as you need to use gfm-yaml_metadata_block to get the previous behavior.
Basic +yaml_metadata_block is by default, and if --standalone is passed in command line, the YAML block will be added in the output .md document. Which was not the case before this new extension.
We allow that only for markdown format I think when preserve_yaml = TRUE only. So it should probably work the same for those format too.
I think we need to update md_document() and github_document() to take that into account regarding preserve_yaml = FALSE.
Note that github_document() is not affected currently I think because we don't use the default Pandoc template for commonmark and we don't have titleblock variable in ours.
Default template is
Looking more into how this works for md_document(), it seems we don't handle well markdown variants with Pandoc. Notable things are
Including --standalone or not will allow to add or not the metadata in the output
Some format includes by default some metadata header (which is the change that happened here)
YAML blocks are not the only metadata format. markdown_mmd support mmd_title_block for example, which I think would be better to use than YAML if we want to preserve the header for this output.
So we could fix this quickly by just handling the gfm / commonmark change in Pandoc 2.13 or try to clean the way it works. Maybe the former is better short term and we could work on the other long term with help of new Pandoc toolings maybe.
This old thread has been automatically locked. If you think you have found something related to this, please open a new issue by following the issue guide (https://yihui.org/issue/), and link to this old issue if necessary.
This was first reported in tidyverse/reprex#375 and needs to be handled in rmarkdown directly.
Pandoc 2.13 added support for
yaml_metadata_block
tocommonmark
in addition tomarkdown
: jgm/pandoc@c389211This impact
gfm
andcommonmark_x
for which it is activated by default. The change forgfm
is a breaking change as you need to usegfm-yaml_metadata_block
to get the previous behavior.Basic
+yaml_metadata_block
is by default, and if--standalone
is passed in command line, the YAML block will be added in the output.md
document. Which was not the case before this new extension.We allow that only for
markdown
format I think whenpreserve_yaml = TRUE
only. So it should probably work the same for those format too.I think we need to update
md_document()
andgithub_document()
to take that into account regardingpreserve_yaml = FALSE
.Note that
github_document()
is not affected currently I think because we don't use the default Pandoc template forcommonmark
and we don't havetitleblock
variable in ours.Default template is
The text was updated successfully, but these errors were encountered: