Skip to content

fix(removeHiddenElems): remove all unreferenced elements, not just the last#1955

Open
johnkenny54 wants to merge 3 commits intosvg:mainfrom
johnkenny54:removeHiddenElems
Open

fix(removeHiddenElems): remove all unreferenced elements, not just the last#1955
johnkenny54 wants to merge 3 commits intosvg:mainfrom
johnkenny54:removeHiddenElems

Conversation

@johnkenny54
Copy link
Copy Markdown
Contributor

removeHiddenElems was only removing the last of a chain of unreferenced elements - e.g., if a is referenced by b is referenced by c, and all are otherwise unreferenced, only c will be removed.

There is no change in regression mismatches or pixel mismatches. Total file compression in single-pass mode is increased by 19,540,048 bytes (2.5%). With the previous version, one link in the chain would be removed with each pass in multi-pass mode.

@johnkenny54 johnkenny54 marked this pull request as ready for review February 6, 2024 03:07
folknor added a commit to folknor/svgo that referenced this pull request Feb 18, 2026
- ignore malformed style attributes in minifyStyles
  svg#2054
- fix: removeHiddenElems is not idempotent
  svg#1955

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
@KTibow KTibow added the merge conflicts Changes currently conflict with main label Mar 8, 2026
@KTibow KTibow changed the title fix: removeHiddenElems is not idempotent fix(removeHiddenElems): remove all unreferenced elements, not just the last Mar 13, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

merge conflicts Changes currently conflict with main

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants