Repository navigation
fix(capture): distinguish SVG namespaces from attribute values - #5238
Closed
user-github-me wants to merge 1 commit into
Closed
user-github-me wants to merge 1 commit into
user-github-me wants to merge 1 commit into
Conversation
Collaborator
|
Thanks for this. The failure needs an SVG attribute value that literally contains |
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.
Capturing an inline SVG whose label contains text such as
xmlns=demosaves a logo that fails to load as an image:toStandaloneSvgmistakes the label text for a namespace declaration and omits the real SVG namespace. The same regex handling also misreads xlink-looking labels and quoted tag delimiters.Read namespace declarations and xlink usage from parsed attribute names, then insert the required declarations into the original source. Preserve artwork and label bytes, and leave already-declared SVGs unchanged. This uses the CLI's existing linkedom dependency.
Validation: seven added regressions fail on main, including an actual asset download; all 374 related capture/command tests pass with the fix. Eight Chrome 152 cases run through the real token extractor and asset downloader, then load each saved SVG as an image and verify its dimensions, label, and expected pixel. Existing namespace cases retain byte-identical source. CLI build/typecheck, root lint, formatting, comments, and commit hooks passed.