Repository navigation
fix: render svg previews as images instead of inlining them - #4298
Merged
Merged
Conversation
1 of 7 tasks
AlexAndBear
force-pushed
the
fix/preview-svg-as-image
branch
from
November 9, 2026 11:27
8014bd0 to
33cea2e
Compare
JammingBen
approved these changes
Nov 9, 2026
JammingBen
left a comment
Member
There was a problem hiding this comment.
LGTM, only one tiny nitpick (not 100% sure if it makes sense, but I guess).
Co-authored-by: Jannik Stehle <[email protected]>
kulmann
approved these changes
Nov 9, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Description
The preview showed SVGs inline in the page, so their content ran in Web itself: an event handler on the root
<svg>was executed, and a<style>inside the SVG applied to the whole page (and could load external resources where the CSP allows them). SVGs are now shown as an image like other pictures, where the browser runs no scripts, loads nothing external and keeps the CSS inside the image. The image is adata:URL instead of ablob:one, so opening it in a new tab doesn't run it on Web's origin either.The preview no longer needs
vue-inline-svgor DOMPurify. This supersedes #4221.Related Issue
How Has This Been Tested?
data:image/svg+xmlURL with the file content and never to ablob:URL, and render as a single imageonanimationstarthandler on the root fired an alert on main; now it just renders<style>changed the page background and requested external URLs on main; now the page stays unchanged and nothing is requestedTypes of changes