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

simplify-colors removes default value (overwrites CSS) #221

Closed
JoKalliauer opened this issue Nov 10, 2018 · 1 comment
Closed

simplify-colors removes default value (overwrites CSS) #221

JoKalliauer opened this issue Nov 10, 2018 · 1 comment

Comments

@JoKalliauer
Copy link

JoKalliauer commented Nov 10, 2018

Prozessing File:Crd_Dadd11_slash_F_sharp_200233.svg with default-values of scour removes style="fill:#000000;" completely.

This seems to be another symptom of #174 but maybe files containg CSS should only simplify-colors, but deactivate removement of default values.

scour -i Input.svg.txt -o Output.svg.txt --indent=space --nindent=1 --disable-style-to-xml

--disable-style-to-xml because of #176

Input

Input.svg.txt

<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE svg  PUBLIC '-//W3C//DTD SVG 1.1//EN'  'http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd'>
<svg width="200" height="200" xmlns="http://www.w3.org/2000/svg">
 <rect width="100%" height="100%" fill="red"/>
 <defs>
  <style type="text/css">.fil0 {fill:#FFFFFF}</style>
 </defs>
 <path class="fil0" d="m21.509 160h-2.1902l-0.87-2.2644h-3.9836l-0.82134 2.2644h-2.1345l3.8816-9.9647h2.1276l3.9905 9.9647zm-3.7051-3.9418-1.3736-3.6983-1.3458 3.6983h2.7194z" style="fill:#000000"/>
</svg>

input

Output

Output.svg.txt

<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE svg  PUBLIC '-//W3C//DTD SVG 1.1//EN'  'http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd'>
<svg width="200" height="200" xmlns="http://www.w3.org/2000/svg">
 <rect width="100%" height="100%" fill="red"/>
 <defs>
  <style type="text/css">.fil0 {fill:#FFFFFF}</style>
 </defs>
 <path class="fil0" d="m21.509 160h-2.1902l-0.87-2.2644h-3.9836l-0.82134 2.2644h-2.1345l3.8816-9.9647h2.1276l3.9905 9.9647zm-3.7051-3.9418-1.3736-3.6983-1.3458 3.6983h2.7194z"/>
</svg>

output

Workaround

--disable-simplify-colors --disable-style-to-xml

Copyright

Lizense: CC-BY-SA 3.0

Author:  user:Mjchael

Source: https://commons.wikimedia.org/wiki/File:Crd_Dadd11_slash_F_sharp_200233.svg

@JoKalliauer
Copy link
Author

This seems to be another symptom of #174 but maybe files containg CSS should only simplify-colors, but deactivate removement of default values.

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

No branches or pull requests

1 participant