rstudio / rmarkdown

Dynamic Documents for R
https://rmarkdown.rstudio.com
GNU General Public License v3.0
2.88k stars 975 forks source link

Trouble embedding iframe tags using rmarkdown 0.9.5 #671

Closed lcolladotor closed 8 years ago

lcolladotor commented 8 years ago

Hi,

The following simple R Markdown file used to embed an iframe.


---
output:
  html_document:
    theme: united

---

[L. Collado-Torres](http://bit.ly/LColladoTorres) Curriculum vitae
================

<iframe src="http://docs.google.com/viewer?url=http://lcolladotor.github.io/cv/en_CV_lcollado.pdf&embedded=true" width="900" height="780" style="border: none;"></iframe>

Source that rendered into this html file.

However using rmarkdown version 0.9.5 and pandoc 1.17.0.3, the iframe tag is not working as intended. I modified my original Rmd file to add some version info and uploaded the resulting html file at https://gist.github.com/lcolladotor/0cc9014d1591d38b7ebf20140842d1a9.

The error is fairly simple. At https://gist.github.com/lcolladotor/0cc9014d1591d38b7ebf20140842d1a9#file-index-html-L116 we can see that < got changed into &lt; and put inside a <p> tag.

Best, Leo

yihui commented 8 years ago

Replace & with &amp; in the iframe URL, otherwise it is not valid HTML to Pandoc so it will be treated as normal text.

lcolladotor commented 8 years ago

Thanks Yihui!

github-actions[bot] commented 4 years ago

This old thread has been automatically locked. If you think you have found something related to this, please open a new issue by following the issue guide (https://yihui.org/issue/), and link to this old issue if necessary.