ramnathv / htmlwidgets

HTML Widgets for R
http://htmlwidgets.org
Other
792 stars 205 forks source link

Remove indentation when rendering HTML into pandoc #395

Closed andrewdenner closed 1 year ago

andrewdenner commented 4 years ago

When the html object contains nested tags, the default behaviour is for renderTags to indent the code. This causes an issue when the generated text is parsed by pandoc later on. Pandoc parses the indented block as "Verbatim (code) blocks", escaping it as text in the HTML and wrapping it in <pre><code> tags, The result is a non-functional widget.

To avoid this, set indent = FALSE in the call to renderTags, avoiding this opportunity for pandoc to misinterpret the input file. Believe that this fixes #358

cpsievert commented 1 year ago

Thanks for the contribution, I think we'll be taking this as a part of #401