SVG files work in Preview but not in View

Description

Hello!

After we’ve updated our Confluence to 8.5.5 the Plant UML macro no longer works on our pages in view mode.

If the user selects “preview” the macro renders properly.

Environment

Confluence Data Centre 8.5.5

Attachments

6

Activity

Michael Griffel March 6, 2024 at 10:42 AM

Hi Sebastian,

thank you for the feedback.

A “fix” for this means that the svg macro needs to be rewritten because the SVG content cannot be injected as macro output any. Since the svg macro is deprecated and disabled by default I would recommend to use other plugins from the marketplace that support SVG images from attachment.

I’m sorry that I cannot help here anymore.

Kind Regards,

Michael

Sebastian Lamoureux March 5, 2024 at 9:41 PM

Hi ,

Atlassian got back to us saying that it’s not them that will fix it, but it’s up to the third party provider to apply a fix.

They suggested you (they/3rd parties) open a development support ticket here: Developer and marketplace support (atlassian.com) where there are issues.

Best,

Sebastian

Sebastian Lamoureux February 21, 2024 at 9:06 PM

Hi ,

Thank you for your investigation and getting back to me!

I’ve reached out to Atlassian regarding the issue to see if they can propose a solution, or know of a configuration we can do to get around this.

By all means you can go ahead and close the ticket. Thank you again for the time you took to investigate!

Best,

Sebastian

Michael Griffel February 21, 2024 at 3:42 PM

Hello ,

thank you for sharing the SVG. I can reproduce the problem.

The problem is caused by some post-processing of the XHTML content (page content) inside Confluence. There is a so called PolicyConfiguredCleaner that removes CSS patterns like “style” attributes (CSS_CLEANING_EXTRACT_PATTERN):

However this post-processing seems not to be executed in the preview mode.

When I compare the SVG in preview mode with the SVG in the page then I see that some of the style attributes are removed from the SVG with causes this problem:

I looked at the code but I did not find a solution to prevent Confluence to suppress this XHTML cleanup.

There is a 20 years old feature request to embed SVG in Confluence: https://jira.atlassian.com/browse/CONFSERVER-1762 that is still open. Also the “workaround” to use SVG Out plugin do not work with your SVG.

I’m really sorry but I think I cannot help here anymore. I guess transforming the SVG to PNG is not an option …

Sebastian Lamoureux February 21, 2024 at 2:03 PM

Here you are, !

Details

Assignee

Reporter

Components

Affects versions

Priority

Created February 12, 2024 at 9:13 PM
Updated March 6, 2024 at 10:42 AM