Repository navigation
Conversation
postcss-values-parser re-tokenizes the inside of an unquoted url() and throws on characters like ';' (e.g. url(data:image/png;base64,...)), although postcss accepts them as a single url token. Quote unquoted url() contents before handing values to the parser. Fixes #351
Collaborator
Author
|
@XhmikosR I couldn't find the issue where we discussed this before - it was some package upgrade pull request I think. I am not a massive fan of this, but the automatically reported issue is real. |
Member
|
@joscha: is this an issue due to the is-url-superb change? If so, why don't we switch back to the old dep assuming it doesn't have the bug? |
Collaborator
Author
|
I think they are unrelated - |
This branch has not been deployed
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Fixes #351.
postcss.parse()accepts an unquotedurl(data:image/png;base64,...)as a single url token, butpostcss-values-parser6.x re-tokenizes the inside ofurl(...)and throwsCssSyntaxError: Unknown word ;(not wrapped asMalformedCssError). It affected@importand@valueby default, and declarations with{ url: true }.Fix: a
parseValue()helper quotes unquotedurl()contents before they reachpostcss-values-parser. Existing quoted strings are skipped. Results are unchanged for consumers; data URLs are still ignored.Tests:
src/__tests__/issue.351.spec.tscovers each case from the issue, both with a data URL alone and next to a real reference.Upgrading
postcss-values-parseris not an option for now: 7.x/8.x are acss-treerewrite with a different node API and higher Node requirements.