How do I render SVG files in Confluence

Erik Saline June 29, 2016

How do I get SVG images to render as the image and not the paper clip icon in Confluence 5.8.4?  I followed the details here with no luck, https://bobswift.atlassian.net/wiki/display/info/How+to+display+SVG+attachments+in+Confluence.

Using the HTML Macro works but it we would like it to work through the attachments feature.

 

Any ideas would be very help!

 

Screen Shot 2016-06-29 at 3.08.32 PM.png

 

 

2 answers

1 accepted

12 votes
Answer accepted
Trevan Householder_Isos-Tech-Consulting_
Rising Star
Rising Star
Rising Stars are recognized for providing high-quality answers to other users. Rising Stars receive a certificate of achievement and are on the path to becoming Community Leaders.
June 30, 2016

We've wanted to do this as well.  However, following the instructions in the article didn't work for us (Confluence Server 5.8.17.  Adding that line to mime.types didn't do the trick for us. (yes, we restarted.))

Last night, we found this trick to make it work:

Upon editing the Confluence Page:
1) Type '!' then select the attached SVG
2) It renders inline
3) Adjust the image size as needed.

Patrick O_Connell December 10, 2019

Well!

We're running 6.9.0/server here, and I can confirm that this works. I was particularly interested in animated SVG, so I tested with both. It works with both static and animated SVGs.

Sneaking in the back door, as it were!


Best,
Pat O'Connell
Technical Writer
MindGeek Montreal

jason_s April 6, 2020

This works for me as well with Confluence 6.15.9.


I'm not sure why drag-and-drop doesn't work, though, the way other image files like .png and .jpg do.

1 vote
Doug Swartz
Rising Star
Rising Star
Rising Stars are recognized for providing high-quality answers to other users. Rising Stars receive a certificate of achievement and are on the path to becoming Community Leaders.
June 29, 2016

Here's a real ugly way to do it.

Embed the SVG code inside an HTML macro.

You wouldn't want to do this way all the time, but it works.

Erik Saline June 29, 2016

Thanks for the quick response, I forgot to mention that the end user does not want to use the HTML macro feature.

Suggest an answer

Log in or Sign up to answer
TAGS
AUG Leaders

Atlassian Community Events