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

Ensure escaped colons do not break selector transformations#11

Merged
jonathantneal merged 3 commits intocsstools:masterfrom
thecrypticace:feature/fix-escaped-colons
Sep 18, 2018
Merged

Ensure escaped colons do not break selector transformations#11
jonathantneal merged 3 commits intocsstools:masterfrom
thecrypticace:feature/fix-escaped-colons

Conversation

@thecrypticace
Copy link
Copy Markdown
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
Copy Markdown
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
Copy Markdown
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
Copy Markdown
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.

2 participants