-
-
Notifications
You must be signed in to change notification settings - Fork 978
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
use yaml_metadata_block for preserve_yaml feature when possible #2190
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks good. Thanks!
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Please feel free to merge after adding a news item. Thanks!
Do we want to merge this for the next release mid-august planned for the IDE ? I am hesitant as there would not be much time for this to live in dev version in case I missed something. |
I don't feel this is a risky change that would affect users widely, so I'm okay with merging it into the next release. |
[skip ci]
[skip ci]
This will fix #2118 and modify a bit how
md_document()
is working internally--standalone
) document ifpreserve_yaml = TRUE
yaml_metadata_block
depending on the value ofvariant
andpreserve_yaml
. This is because some formats have the extension set or unset by default, and also depending of the pandoc version.Doing this should handle correctly most of the case. Let's add that
--standalone
flag will produce this header, and that some format will have special header if not yaml:markdown
will have apandoc_title_block
if not a YAML blockmarkdown_mmd
will havemmd_title_block
if YAML block is unset.For now, this is the behavior we apply for all variants:
md_document(preserve_yaml = TRUE)
will always produce a YAML block.md_document(preserve_yaml = FALSE)
will always produce no YAML block.And this is currently not working which is the main issue of #2118
Should we do something simpler or does it seems like a right thing to do ?