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
Robustness : fix a case where tokenizer state is broken #1001
Comments
Hey @abarre. Thanks for coming back to report the issue - your solution seems right and straightforward to implement. Would you send a PR? |
abarre
added a commit
to abarre/clean-css
that referenced
this issue
Feb 25, 2018
- case of roundBracketLevel inferior to 0.
jakubpawlowicz
pushed a commit
that referenced
this issue
Mar 5, 2018
jakubpawlowicz
pushed a commit
that referenced
this issue
Mar 5, 2018
jakubpawlowicz
added a commit
that referenced
this issue
Mar 5, 2018
Thanks @abarre - I've merged it to master and 4.1 due in 4.1.10 soon. |
jakubpawlowicz
added a commit
that referenced
this issue
Mar 5, 2018
Fixed in 4.1.10. |
This was referenced Mar 10, 2021
Merged
This was referenced Mar 17, 2021
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Our solution minifies CSS from various websites and some CSS have "corrupted CSS portion". One case completely breaks the tokenizer state and destroy all URL in the CSS file.
If a corrupted CSS portion contains a
)
, the variableroundBracketLevel
will be -1. Then, all URL in the rest of the file won't be correctly parsed and will be deleted.The patch I found is adding a line that states that
roundBracketLevel
is always a positive integer in the for loop that parse the CSS code :Environment
npm ls clean-css
: clean-css@4.1.9node -v
: v8.9.4Configuration options
Input CSS
Actual output CSS
Expected output CSS
The text was updated successfully, but these errors were encountered: