Skip to content
This repository has been archived by the owner on Mar 26, 2024. It is now read-only.

iframe in a raw directive breaks the home page #71

Closed
sgillies opened this issue Oct 5, 2014 · 3 comments
Closed

iframe in a raw directive breaks the home page #71

sgillies opened this issue Oct 5, 2014 · 3 comments
Labels

Comments

@sgillies
Copy link
Contributor

sgillies commented Oct 5, 2014

I'm using

.. raw:: html

   <iframe frameborder="0" width="100%" height="300" src="http://bl.ocks.org/d/dcfe6ce4e7fa7b2e00e9"></iframe>

In a post. The post's own page converts to HTML (--build or --preview) with no problems, but the home page is broken. Everything after the iframe is dropped.

@vladris
Copy link
Owner

vladris commented Oct 15, 2014

This looks like an upstream bug. Tinkerer runs each post page through PyQuery to patch some relative links and other stuff. Looks like in the process, <iframe ...></iframe> gets turned into <iframe />. This seems to be the reason browser doesn't read this correctly. There is no particular logic for dealing with iframes, so this is either PyQuery or lxml issue that it collapses open and closed tags into a single one. I'll dig some more into it if I have time to spare, but I doubt I can locally fix it in Tinkerer...

@vladris
Copy link
Owner

vladris commented Oct 15, 2014

Looks like this happens with any open/closed tags with no content. On the other hand, there seems to be a simple fix: just add a space between the iframe tags. The parser will consider it as content and it will no longer collapse them into a single tag.

I'll Won't Fix this issue since there is a simple workaround and it's an upstream problem anyway.

@vladris vladris closed this as completed Oct 15, 2014
@sgillies
Copy link
Contributor Author

@vladris thanks for the workaround recommendation!

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Projects
None yet
Development

No branches or pull requests

2 participants