On 2014-01-09 16:10, Nick Dokos wrote:
Exporting this to HTML produces <img> tags like this:
,----
| <div class="figure">
| <p><img src="foo.svg" alt="foo.svg" />
| </p>
| </div>
|
|
| <div class="figure">
| <p><img src="foo.png" alt="foo.png" />
| </p>
| </div>
`----
I attach a patch[fn:1] that changes these to <object> tags (the patch
is
proof-of-concept only, not meant for integration into org core - it'll
need a fair amount of work before that happens, if it ever happens.)
With the patch, the relevant output is changed to this:
,----
| <div class="figure">
| <p><object data="foo.svg" type="image/svg+xml"> </object>
| </p>
| </div>
|
|
| <div class="figure">
| <p><object data="foo.png" type="image/png"> </object>
| </p>
| </div>
`----
Open questions
Do I have this right? I'm neither an SVG nor an HTML expert. If there
is
another way to do what I want, please let me know.
Do most browsers support <object> tags? Do they do the right thing with
images in <object> tags?
BTW, I tried using
<object data="foo.png" type="image/png"/>
This does not work because the close tag is required according to the
spec (like a script tag).
From a quick read on the interwebs, yes, it seems that <object> is an
html4 specification. One problem with your solution, is that <object>
does not allow an 'alt' attribute
The problem w/ <img src='foo.svg"/> according to my reading, is that
it is not officially supported, and is only incidentally supported by
the browsers (but, as you can see, without svg interactivity).
I thing the solution is to use an <object> tag for svg, but an <img>
tag for the rest. It might also make sense to just inline the svg?
see:
http://www.w3.org/Graphics/SVG/IG/resources/svgprimer.html#SVG_in_HTML
for an interesting writeup on the issues.
rick