GitLab does not render SVG's embedded in markdown #50
Reference in New Issue
Block a user
Delete Branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Bug Report
Environment
Not applicable
Summary
GitLab does not render SVG's embedded in markdown (via
).Multiple documents are affected.
Expected Behavior
The embedded SVG should be displayed.
Actual Behavior
Only the image discription is displayed.
Steps to Reproduce
Stack Trace / Error Message
Possible Cause / Notes
GitLab does this, to prevent XSS as SVGs are based on XML which can contain active components.
Source: https://gitlab.com/gitlab-org/gitlab-foss/-/work_items/27471
Checklist
assigned to @lars.winzer
created branch
chore/50-change-used-markdown-embed-techniqueto address this issueThe alternative is using the
<img src="" alt="" />tag.Note that this variant is stricter when it comes to paths, using relative paths instead of absolute paths is recommended.
After some trial and error it seems likely that this instance has the rendering of SVGs deactivated entirely (as the preview of SVG files themself dont show up either).
So nothing we can work arround. Only option is then to export and embed the images as PNG instead of SVG.
added 25m of time spent at 2026-04-04 12:00:00 +0200
mentioned in task #51
marked this issue as related to #51
mentioned in merge request !79
mentioned in commit
aca8924f15