Skip to content
This repository has been archived by the owner on Jun 6, 2022. It is now read-only.

Ensure escaped colons do not break selector transformations #11

Merged

Conversation

thecrypticace
Copy link
Contributor

Currently, escaped colons are not considered in selector transformations and so a statement like this: .sm\:not-italic { font-style: normal; } will error out because it contains a :not in it and this confused the selector parsing code.

Fixes #10

cc @adamwathan

@jonathantneal
Copy link
Contributor

This looks good. @Semigradsky, any hesitation in pulling this in, or may I?

I would accept this as-is right now, and then later switch to postcss-selector-parser if possible.

@jonathantneal
Copy link
Contributor

I think this is now resolved in the latest version of the postcss-selector-parser.

The regex is set up to ensure that escaped colons are not considered when looking for :not.

This slows down selector transformation by about 25%
This provides a pretty decent speedup. Overall selector matching is now slight slower by about 6% instead of 25%.
@thecrypticace
Copy link
Contributor Author

It does not appear so. I ran the tests against the master branch and still get failures.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants