mirror of
https://github.com/svg/svgo.git
synced 2026-01-27 07:02:06 +03:00
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.
21 lines
373 B
XML
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>
|