Skip to content

Instantly share code, notes, and snippets.

What would you like to do?
How to get pandoc 2+ to retain HTML tags in markdown?
## foo `bar`
x <- 5
<p align="center">test</p>
I can't figure out how to convert this to markdown using rmarkdown::render() without stripping the `<p>` tag around `test`. (You need to view the "raw" version of this file to see that there is a `<p>` tag, because github renders it as HTML)
rmarkdown::render("test.Rmd", output_format = "md_document", output_options = list(pandoc_args = c("-t", "commonmark"), md_extensions = c("+raw_html", "+raw_attribute")))
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment