The live notebook looks for an "isolated": true flag in the metadata to put SVG/HTML in an iframe. However, conversion to static HTML appears to ignore this flag.
I suspect that this is the cause of IRkernel/IRkernel#198.
maybe this can work with static documents by doing <iframe src="data:...">
It looks like there's a srcdoc attribute, so you can do <iframe srcdoc="<h1>Boo</h1>"/>. Ugly, but better than a base-64 data URL. Not supported in IE, though.
neither does it support src, so let鈥檚 use this for IE.
srcdoc sounds good. we only need to escape " and put it into srcdoc then?
maybe we should special-case SVG and use <img src="data:...">?
I think the srcdoc approach we described before is nicer than base64-ing text data.
i meant using imgs generally for SVG. but the most important thing is to get it in :wink:
Is this still open?
Also, given the concerns elsewhere (https://github.com/jupyter/nbconvert/issues/328) that seem pro data URIs why is there anti data URI sentiment here? Is that not a valid solution?
the other thread doesn鈥檛 mention srcdoc, so that should work.
HTML/XML attribute values (strings) can span multiple lines, so we just need to think about quoting. would it be enough to
& with & (so no entities will be expanded in the string)" with " (so the string isn鈥檛 ended prematurely)this would result in this doc
<div title="baz"" id='a'>
…
</div>
being emedded like so:
<iframe srcdoc="<span title="baz&quot;" id='a'>
&hellip;
</span>"></iframe>
which makes it still more readable than base64 encoded data.
to make it even more readable, we could just replace the & in all entities that expand to ". there鈥檚 ", the decimal and hexadecimal entities, and what else?
@michaelpacer data URIs are an OK if somewhat ugly way of embedding binary data like images into a text-based format like HTML. Encoding HTML, which is already text, into unreadable base64 data seems rather inelegant. That's why I prefer the srcdoc approach.
I can revisit this if desired after the 5.2 release.
this is definitely still wanted, thank you!
Removing milestone altogether as no one is pushing this change into PR form.
Most helpful comment
I can revisit this if desired after the 5.2 release.