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

prefixIds does not apply prefix in non-trivial begin/end expressions of animate tag #2073

Open
alex-kowalczyk opened this issue Sep 8, 2024 · 0 comments
Labels

Comments

@alex-kowalczyk
Copy link

alex-kowalczyk commented Sep 8, 2024

Describe the bug
Seems that #848 is fixed only partially, for simple expressions - the fixing commit splits by '; ' and checks for .end presence via endsWith() , and follow-up changes drag that limitation too:
https://github.com/svg/svgo/blame/main/plugins/prefixIds.js#L253

For the following example, being a fragment of animation of rain drops, coming from https://github.com/basmilius/weather-icons (partly-cloudy-day-rain.svg):

<animate id="y1" attributeName="opacity" begin="0s; y1.end+.33s" dur=".67s" keyTimes="0; .25; 1" values="0; 1; 0"/>

the result is:

<animate id="partly-cloudy-day-rain_svg__j" attributeName="opacity" begin="0s; j.end+.33s" dur=".67s" keyTimes="0; .25; 1" values="0; 1; 0"></animate>

To Reproduce
Steps to reproduce the behavior:

Expected behavior

<animate id="partly-cloudy-day-rain_svg__j" attributeName="opacity" begin="0s; partly-cloudy-day-rain_svg__j.end+.33s" dur=".67s" keyTimes="0; .25; 1" values="0; 1; 0"></animate>

Desktop (please complete the following information):

  • SVGO Version: 3.3.2
  • NodeJs Version: 20
  • OS: Linux
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

1 participant