svg images are linked in a way browsers don't like

Dustin Mitchell avatarDustin Mitchell created an issue

If overview.svg exists, then

.. image:: _images/overview.*
   :alt: Overview Diagram

turns to

<object data="_images/overview.svg" type="image/svg+xml"><embed src="_images/overview.svg" type="image/svg+xml"></object>

using the HTML builder. In Firefox, this renders as an object needing a plugin (for which no plugin exists). On Chrome, the browser tries to download the images. On Safari, the images are displayed, but inside small boxes with scroll bars.

I think the much simpler <img src="_images/overview.svg"> would work, perhaps with a warning that older browsers do not adequately support SVG, and that bitmap-based formats should be used instead where extreme browser compatibility is important.

Comments (3)

  1. Benoît Allard

    On a similar note, the graphviz extension also link SVG that way. From the page where the original SVG patch comes from:

    I had to use the object tag because Firefox can’t render SVG with the img tag. Read more about cross browsing SVG issues

    Which was end of 2009 and is far from true now. I propose that every SVG inclusion should now use the img tag.

  2. Log in to comment
Tip: Filter by directory path e.g. /media app.js to search for public/media/app.js.
Tip: Use camelCasing e.g. ProjME to search for
Tip: Filter by extension type e.g. /repo .js to search for all .js files in the /repo directory.
Tip: Separate your search with spaces e.g. /ssh pom.xml to search for src/ssh/pom.xml.
Tip: Use ↑ and ↓ arrow keys to navigate and return to view the file.
Tip: You can also navigate files with Ctrl+j (next) and Ctrl+k (previous) and view the file with Ctrl+o.
Tip: You can also navigate files with Alt+j (next) and Alt+k (previous) and view the file with Alt+o.