-
-
Notifications
You must be signed in to change notification settings - Fork 979
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Stricter YAML parsing in Pandoc >= 2.2.2 generates Pandoc WARNINGs #1474
Comments
I wonder if we should adopt the convention that
|
…sing Taking a suggestion @kevin_ushey makes in rstudio/rmarkdown#1474 (comment)
Use a YAML list, following rstudio/rmarkdown#1474
I don't see the warning anymore with last Pandoc (2.11.0.4) when trying ---
title: "Habits"
output:
html_document:
pandoc_args: [
"--title-prefix", "Foo",
"--id-prefix", "Bar"
]
--- However, this issue is real as Pandoc uses YAML 1.2 but R package yaml uses 1.1. LibYAML support for 1.2 may be coming: yaml/libyaml#20 YAML version is something we need to watch out while improving our YAML support in Rmarkdown, and RStudio IDE. |
Several updates on this:
It seems there is not yet issue reported with this change. However, Pandoc 2.16 is not yet in the RStudio release version, we could see more later. Also, work is on-going for YAML validation in the IDE. This will probably help and solved such issue by helping with formatting and completion. |
Created on 2018-11-04 by the reprex package (v0.2.1)
Session info
As of version 2.2.2, Pandoc parses YAML with HsYAML, which has a stricter interpretation of YAML 1.2 than the previous approach.
https://github.com/jgm/pandoc/blob/b8573aab292cc7c75b9a7268602799e7abda5f81/changelog#L953-L959
It's pretty common to see
yes
used as a true value in.Rmd
documents, although perhaps it is always in theoutput
key, which is parsed by Pandoc but not actually used. That YAML is used by rmarkdown itself. It still might be a good idea to shift fromyes
toTRUE
in YAML we produce, in the long run.Here is the one semi-breakage I see: indentation in a multi-line YAML collection.
Take the YAML from 3.1.10.5 Pandoc arguments in R Markdown: The Definitive Guide
If I use
rmarkdown::render()
or the IDE's Knit button on this, I see these WARNINGs, but the render still works:Changing the indentation clears the WARNING:
The text was updated successfully, but these errors were encountered: