# How to export svg images as <img …> in html export

Normally, when I export to html an org-mode buffer that contains a link to an image, the link is coverted to a proper html <img...>. However, if that image has a .svg extension, it is exported as an <object...> instead.

How do I prevent this?

[[file:https://clojars.org/malabarba/lazy-map/latest-version.svg]]


gets exported like this:

<object type="image/svg+xml" data="https://clojars.org/malabarba/lazy-map/latest-version.svg" >
Sorry, your browser does not support SVG.</object>


But I'd like it to be exported like this:

<img src="https://clojars.org/malabarba/lazy-map/latest-version.svg">


Using a :fallback attribute almost does it:

#+ATTR_HTML: :fallback /tmp/toto.svg
[[file:/tmp/toto.svg]]


is exported as:

<div class="figure">
<p><object type="image/svg+xml" data="file:///tmp/toto.svg" >
<img src="/tmp/toto.svg"  /></object>
</p>
</div>


Otherwise, it seems easy to redefine or advice org-html--format-image in ox-html.el (for some reason, it treats svg's specially).

• Thanks. If no-one knows a configuration option for this, I'll just have to advise that function. – Malabarba Nov 16 '15 at 7:39
• @Malabarba can you show us how you advised it? – Linus Arver May 2 '18 at 6:28