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

fix(plugins): Cleanup ids when style/script tag is empty #1130

Merged
merged 3 commits into from Nov 8, 2019

Conversation

dcyriller
Copy link
Contributor

@dcyriller dcyriller commented Jul 19, 2019

cleanupIDs plugin is not run when a script or style tag is present. I assume that this is because they might contain an id.

If the tags are empty we can clean these ids though.

When running svgo with the option multipass: true, it allows us to first run inlineStyles plugin to empty the style tag. Then, we can run cleanupIDs plugin.

In the new test, an example of this transformation!

dcyriller and others added 3 commits July 19, 2019 11:29
With a empty style tag in the file, ids should be properly cleaned up.
cleanupIDs plugin is disabled when a script or style tag is present. I
assume that this is because they might contain an id.

If these tags are empty there is no point in not cleaning the id though.
When running svgo with the option `multipass: true`, it allows us to
first run `inlineStyles` plugin to empty the style tag. Then, we can run
`cleanupIDs` plugin.
@GreLI GreLI merged commit 1152257 into svg:master Nov 8, 2019
@dcyriller dcyriller deleted the fix-id-prefix-with-style branch November 8, 2019 20:50
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants