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?

For instance, the following link:


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">

1 Answer 1


Using a :fallback attribute almost does it:

#+ATTR_HTML: :fallback /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>

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, 2015 at 7:39
  • @Malabarba can you show us how you advised it? May 2, 2018 at 6:28
  • It works great! How have you discovered that?
    – Felipe
    Sep 16, 2020 at 21:42

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge that you have read and understand our privacy policy and code of conduct.

Not the answer you're looking for? Browse other questions tagged or ask your own question.