我正在尝试将RMarkdown文件转换为Markdown,以便发布到Github网页(jekyll)网站。由于图标题需要扩展,我使用jekyll主题建议的方法来添加标题。问题是,当从.Rmd
解析到.md
时,图形的代码不会逐字记录,并且会以破坏jekyll的方式进行解析。
拿这个MWE:
---
title: "MWE"
output:
md_document:
preserve_yaml: TRUE
variant: markdown_strict+backtick_code_blocks
---
## Test title
Text goes here.
{% include figure image_path="https://upload.wikimedia.org/wikipedia/commons/4/4e/Macaca_nigra_self-portrait_large.jpg" caption="Caption goes here." %}
这被解析为:
---
title: "MWE"
output:
md_document:
preserve_yaml: TRUE
variant: markdown_strict+backtick_code_blocks
---
Test title
----------
Text goes here.
{% include figure
image\_path="<https://upload.wikimedia.org/wikipedia/commons/4/4e/Macaca_nigra_self-portrait_large.jpg>"
caption="Caption goes here." %}
请注意大括号内末尾的文本,特别是image_path
中的下划线现在已转义,并且URL被括起来。我想逐字记录这段代码:
{% include figure image_path="https://upload.wikimedia.org/wikipedia/commons/4/4e/Macaca_nigra_self-portrait_large.jpg" caption="Caption goes here." %}
我正在使用R v3.3.3
,rmarkdown v1.2
,pandoc v1.17.2
和RStudio v1.0.136
。有什么建议吗?