Skip to content

Instantly share code, notes, and snippets.

@daattali
Last active February 13, 2018 05:16
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save daattali/33dacbfa8a2efb20e617926d762475b7 to your computer and use it in GitHub Desktop.
Save daattali/33dacbfa8a2efb20e617926d762475b7 to your computer and use it in GitHub Desktop.
How to get pandoc 2+ to retain HTML tags in markdown?
## foo `bar`
hello
```
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