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

Ignore url() values when minifying CSS #82

Closed
Sandmania opened this issue Dec 17, 2014 · 4 comments
Closed

Ignore url() values when minifying CSS #82

Sandmania opened this issue Dec 17, 2014 · 4 comments

Comments

@Sandmania
Copy link

Lets say you have the following filter property in your css

filter: url("data:image/svg+xml;utf8,<svg version='1.1' xmlns='http://www.w3.org/2000/svg' height='0'><filter id='greyscale'><feColorMatrix type='matrix' values='0.3333 0.3333 0.3333 0 0 0.3333 0.3333 0.3333 0 0 0.3333 0.3333 0.3333 0 0 0 0 0 1 0' /></filter></svg>#greyscale");

Minify this and you get:

filter:url("data:image/svg+xml;utf8,<svgversion='1.1'xmlns='http://www.w3.org/2000/svg'height='0'><filterid='greyscale'><feColorMatrixtype='matrix'values='0.33330.33330.3333000.33330.33330.3333000.33330.33330.33330000010'/></filter></svg>#greyscale");

And using this you'll get:

XML Parsing Error: not well-formed
Location: data:image/svg+xml;utf8,<svgversion='1.1'xmlns='http://www.w3.org/2000/svg'height='0'><filterid='greyscale'><feColorMatrixtype='matrix'values='0.33330.33330.3333000.33330.33330.3333000.33330.33330.33330000010'/></filter></svg>#greyscale
Line Number 1, Column 12:
<svgversion='1.1'xmlns='http://www.w3.org/2000/svg'height='0'><filterid='greyscale'><feColorMatrixtype='matrix'values='0.33330.33330.3333000.33330.33330.3333000.33330.33330.33330000010'/></filter></svg>
-----------^

@samaxes
Copy link
Owner

samaxes commented Dec 17, 2014

Minify Maven Plugins uses YUI Compressor for CSS minification.
Can you please fill an issue on the project at https://github.com/yui/yuicompressor?

@samaxes samaxes closed this as completed Dec 17, 2014
@Sandmania
Copy link
Author

Ach, right.

It seems there is an issue for this already, lets hope they'll fix it soon:

yui/yuicompressor#141

@samaxes
Copy link
Owner

samaxes commented Dec 18, 2014

Thanks!

@iscadefrango
Copy link

iscadefrango commented Nov 23, 2019

yuicompressor released a jar with a fix for inline svg whitespaces
Here: yui/yuicompressor/pull/319

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

3 participants