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
Multipass, addClassesToSVGElement duplicating classes #659
Comments
Yep, multipass literally runs SVGO several times with all its plugins. Probably, it worth consider for class duplication checking before applying. /cc @AprilArcus. |
Thanks, I'll take this issue. |
Thanks @AprilArcus @GreLI |
@AprilArcus @GreLI Has there been any progress on this issue? I'm running into the same sort of problem when using multipass with prefixIds or when using prefixIds on a file that has already had classes prefixed. |
@mdmoreau: I am just writing some tests in |
@Matt-Butler: So I wrote some tests for |
@strarsis I'm still seeing the same behavior on 1.3.2 unfortunately. Setup a demo at https://github.com/mdmoreau/svgo-demo where an additional class prefix gets added each time SVGO is run. |
@strarsis Tried that on my demo, and noticed a couple of things:
|
@mdmoreau: That they are still prefixed multiple times when they are passed multiple times to |
@strarsis Oh okay - wasn't aware of that. Was hoping that there was some sort of check to see if the prefix existed before re-adding it. Is there a reason something like that couldn't be added? |
@mdmoreau: The reason for all the issues is that the |
addClassesToSVGElement does not add duplicated classes for some time. addAttributesToSVGElement produces duplicated attribute because the whole
Better use object |
The class names are duplicated on the SVG.
The text was updated successfully, but these errors were encountered: