Converts markdown text to several formats using John MacFarlane's https://github.com/jgm/cmark{cmark}
reference implementation. Output in HTML, groff man, CommonMark, and a custom XML format is supported.
Treat newlines as hard line breaks. If this option is specified, hard wrapping is disabled
regardless of the value given with width.
smart
Use smart punctuation. See details.
normalize
Consolidate adjacent text nodes.
sourcepos
Include source position attribute in output.
width
Specify wrap width (default 0 = nowrap).
Details
When smart punctuation is enabled, straight double and single quotes will be rendered as curly quotes,
depending on their position. Moreover -- will be rendered as an en-dash, --- will be
rendered as an em-dash, and ... will be rendered as ellipses.
md <- readLines(curl::curl("https://raw.githubusercontent.com/yihui/knitr/master/NEWS.md"))
html <- markdown_html(md)
xml <- markdown_xml(md)
man <- markdown_man(md)
cm <- markdown_commonmark(md)