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

Allow escaped parentheses in pseudo selectors #20

Merged
merged 1 commit into from
Feb 23, 2018
Merged

Conversation

DShadrick
Copy link
Contributor

allows for the inclusion of escaped parenthesis inside of a sudo selector. Updated previous change to iterate backwards to also allow for the inclusion of escaped escape characters.

index.js Outdated
var slashCount = 0;

while (selector.charAt(--pos) === '\\') slashCount++;
return !!(slashCount&1);
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

return slashCount & 1 === 0;

is a bit more explicit and should be easier to read.

index.js Outdated
}

function checkEscaped(pos) {
var slashCount = 0;
Copy link
Owner

@fb55 fb55 Feb 22, 2018

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Move checkEscaped to the outer scope

@fb55
Copy link
Owner

fb55 commented Feb 22, 2018

Tests are failing & two nits, otherwise lgtm :)

@DShadrick
Copy link
Contributor Author

Made the requested updates and fixed the testing errors.

@fb55 fb55 merged commit c636f0d into fb55:master Feb 23, 2018
@fb55
Copy link
Owner

fb55 commented Feb 23, 2018

Nice, thanks a lot :)

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

Successfully merging this pull request may close these issues.

2 participants