Skip to content
New issue

Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? # 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 DShadrick force-pushed the master branch 2 times, most recently from c4db942 to de002d1 Compare February 22, 2018 22:54
@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 :)

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

Successfully merging this pull request may close these issues.

2 participants