RazrFalcon / svgcleaner

svgcleaner could help you to clean up your SVG files from the unnecessary data.
GNU General Public License v2.0
1.62k stars 93 forks source link

--join-style-attributes changes Rendering #182

Open JoKalliauer opened 5 years ago

JoKalliauer commented 5 years ago

Prozessing 20181110022753%21Test.svg with

svgcleaner Input.svg.txt Output.svg.txt --indent 1 --join-style-attributes some

leads to a change from style="font:bold 40px sans-serif" to font="bold 40px sans-serif"


The option some should maybe not only work for five or more, but also for unknown attributes, this would might also solve problems with CSS-Properties: https://github.com/RazrFalcon/svgcleaner/issues/162


Input

Input.svg.txt

<svg height="200" width="200" xmlns="http://www.w3.org/2000/svg">
 <text style="font:bold 40px sans-serif" x="20" y="45">F<tspan style="font:bold 30px sans-serif" y="35">7</tspan></text>
 <text style="font:bold 12px sans-serif" x="120" y="65">III</text>
</svg>

input

Output

Output.svg.txt

<svg height="200" width="200" xmlns="http://www.w3.org/2000/svg">
 <text font="bold 40px sans-serif" x="20" y="45">F<tspan font="bold 30px sans-serif" y="35">7</tspan></text>
 <text font="bold 12px sans-serif" x="120" y="65">III</text>
</svg>

output


Copyright Lizense: CC-BY-SA 3.0 Author: https://commons.wikimedia.org/wiki/User:Mjchael scource: https://upload.wikimedia.org/wikipedia/commons/archive/b/bd/20181110022753%21Test.svg
RazrFalcon commented 5 years ago

The second one should also work, but no one really support this, afaik.

Will see what can be done here.