Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

removeHiddenElems removes <symbol> which contains children with IDs #1924

Closed
johnkenny54 opened this issue Jan 3, 2024 · 0 comments · Fixed by #1925
Closed

removeHiddenElems removes <symbol> which contains children with IDs #1924

johnkenny54 opened this issue Jan 3, 2024 · 0 comments · Fixed by #1925
Labels

Comments

@johnkenny54
Copy link
Contributor

If the <symbol> itself does not have an ID, removeHiddenElems removes <symbol>elements which contains children with IDs.

To Reproduce
Optimize the following with removeHiddenElems enabled:

<svg xmlns="http://www.w3.org/2000/svg">
    <rect fill="url(#a)" width="64" height="64"/>
    <symbol>
        <linearGradient id="a">
            <stop offset="5%" stop-color="gold" />
        </linearGradient>
    </symbol>
</svg>

Expected behavior
File is unchanged because linearGradient is referenced.

Additional context
This bug is part of the cause of test-regression failures on media-flash.svg.

  • SVGO Version 3.2
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant