cross
New Foswiki release 2.1.6 is available with important security fixes.
Sourceforge foswiki email lists being discontinued. Subscribe to the new Foswiki announce and discuss lists at MailingLists
My Graphs topic contains two versions of a diagram which I created using OmniGraffle. The versions are displayed using the following code:

<img src="%ATTACHURLPATH%/AxAp_Graphs.png" width='250' />
<img src="%ATTACHURLPATH%/AxAp_Graphs.svg" width='250' />

Although both versions display properly, the source code for the SVG image cannot be inspected directly (e.g., using Chrome's Developer Tools).

If I remove the <img src... tags around the URL for the SVG file, Foswiki simply displays the link. If I click on that link, the browser knows what to do. (It opens the file as an SVG image which I can then inspect with the developer tools.)

Is there something I can do to tell Foswiki to display the SVG file inline as an image, the same way that the browser does if I click the link? Is there a types file I need to edit?

As a workaround, I put in a note and a link:

*Note:*
The source code for the righthand (SVG) image above is hidden by the =img= tag.
If you are interested in inspecting the code,
visit [[%ATTACHURL%/AxAp_Graphs.svg][AxAp_Graphs.svg]]
and use your web browser's Developer Tools.

However, I'd prefer to have some Foswiki syntax that let me display the image in an inspectable manner. Help?

-- RichMorin - 18 Aug 2016

Here is some alternative syntax, based on an IRC comment by JulianLevens. It worked fine on one of my pages, but fouled up the formatting on another:

<object data="%ATTACHURL%/AxAp_Graphs.svg" width='250' type="image/svg+xml" />

-- RichMorin - 20 Aug 2016

Just use the svg element: http://www.w3schools.com/html/html5_svg.asp

-- Main.MichaelDaum - 21 Aug 2016 - 18:21

I'm afraid this reply is too cryptic to be of any use to me. The SVG file has an svg element at the top level. Are you suggesting that I also reference the file using an svg tag?

-- RichMorin - 21 Aug 2016
Topic revision: r7 - 22 Aug 2016, RichMorin - This page was cached on 23 Mar 2018 - 03:41.

The copyright of the content on this website is held by the contributing authors, except where stated elsewhere. See Copyright Statement. Creative Commons License