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

[BUG] Optimized SVG is different than source Escudo de Agulo.svg #1362

Closed
sk- opened this issue Feb 22, 2021 · 1 comment
Closed

[BUG] Optimized SVG is different than source Escudo de Agulo.svg #1362

sk- opened this issue Feb 22, 2021 · 1 comment

Comments

@sk-
Copy link
Contributor

sk- commented Feb 22, 2021

Using the (wip) integration test tool we identified an issue while optimizing the file Escudo de Agulo.svg with the default settings.

SVGO version

2.0.2

Differences

The dragon is completely broken and also some of its colors changed.

Sources

Original:

source.svg.txt
Optimized:

optimized.svg.txt

Renders

Here are the two rendered images for comparison:

Original:

source

Optimized:

optimized
Diff:

diff

TrySound added a commit that referenced this issue Feb 22, 2021
Ref #1362 #1360

From the [spec](https://www.w3.org/TR/SVG11/styling.html#UsingPresentationAttributes):

> Presentation attributes have lower priority than other CSS style rules specified in author style sheets or ‘style’ attributes.

Though we replace inline styles with attributes without checking if
thare is any `<style>` element. This makes the plugin unsafe and it
should not be enabled by default.
TrySound added a commit that referenced this issue Feb 22, 2021
Ref #1362 #1360

From the [spec](https://www.w3.org/TR/SVG11/styling.html#UsingPresentationAttributes):

> Presentation attributes have lower priority than other CSS style rules specified in author style sheets or ‘style’ attributes.

Though we replace inline styles with attributes without checking if
thare is any `<style>` element. This makes the plugin unsafe and it
should not be enabled by default.
@TrySound
Copy link
Member

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

No branches or pull requests

2 participants