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

Descendant combinator broken when followed by wildcard or pseudo-class #6

Closed
mischov opened this issue Apr 10, 2017 · 0 comments

Comments

@mischov
Copy link
Owner

commented Apr 10, 2017

Problem

Selectors like css("div :nth-child(2)") or css("div *") are currently broken.

This problem is due to white space greedy tokenization, specifically in the patterns {W}\:{W} and {W}\*{W}.

Because both of these symbols can start a compound selector which can be preceded by a descendant combinator (a space), they cannot be greedy about the white space that precedes them.

Solution

Change the patterns to \:{W} and \*{W}.

@mischov mischov added the A:Bug label Apr 10, 2017

mischov added a commit that referenced this issue Apr 10, 2017
Fix tokenization bug (#6)
  - Fix tokenization of a descendant combinator followed by a wildcard or pseudo-class

@mischov mischov closed this Apr 10, 2017

@mischov mischov added A:Error and removed A:Bug labels Jun 23, 2018

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
1 participant
You can’t perform that action at this time.