1
0
mirror of https://github.com/svg/svgo.git synced 2026-01-27 07:02:06 +03:00
Files
svgo/test/plugins/inlineStyles.23.svg
Seth Falco 5aad38bcc7 fix(inlineStyles): empty css block created empty attribute (#1823)
When running this plugin on an SVG with an empty block in the CSS, it
would apply it to the matched elements by adding an empty `style`
attribute. See the test for an example.

This resolves that by just dropping the declaration if it's empty.
2023-11-07 23:20:48 +00:00

21 lines
373 B
XML

Empty selectors should just be dropped.
===
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 45 35">
<style>
.a {}
</style>
<g class="a">
<circle class="b" cx="42.97" cy="24.92" r="1.14"/>
</g>
</svg>
@@@
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 45 35">
<g>
<circle class="b" cx="42.97" cy="24.92" r="1.14"/>
</g>
</svg>