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

Named colors shortening is overly aggressive #39

Closed
bertptrs opened this issue Apr 18, 2017 · 4 comments
Closed

Named colors shortening is overly aggressive #39

bertptrs opened this issue Apr 18, 2017 · 4 comments

Comments

@bertptrs
Copy link

bertptrs commented Apr 18, 2017

The named color renaming scheme (renaming things such as #FF0000 to red and white to #fff) is a tad too agressive, as it renames occurences everywheren.

In my particular case, it changes url(assets/images/white.png) into url(assets/images/#fff.png), which results in a 404. I suppose the regular expression attempting to rename these colors could be tweaked so that it only works on things that are actually colors, but I'm not sure how.

In the meantime, I'm working around this bug by renaming my file.

@tubalmartin
Copy link
Owner

Thanks for reporting! I will cover that case!

@tubalmartin
Copy link
Owner

Ummm which version of CSSmin are you using? It's working fine on v3.1.2

@bertptrs
Copy link
Author

I'm using 2.4.8-p5, due to using this library indirectly (via mrclay/minify). I can confirm that it does not happen in v3.1.2.

I'll raise a ticket in the Minify project and hope they pick it up soon.

@tubalmartin
Copy link
Owner

Great! Closing this issue! Thanks for reporting anyway. I've added a test for it.

tubalmartin pushed a commit that referenced this issue Apr 18, 2017
"ext-pcre" included in composer.json
Updated README to include #39
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

2 participants