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

Bug #7533. Fix for IDs which contain CSS3 selector meta characters #37

Closed
wants to merge 4 commits into from

Conversation

jitter
Copy link
Contributor

@jitter jitter commented Nov 24, 2010

This should fix various bugs when we try to select by ID but the ID contains CSS 3 selector meta characters and thus confuses qSA when not escaped.

Please double check if I missed some in the regex.

@jeresig
Copy link
Member

jeresig commented Nov 30, 2010

Why not just do [id='THEID'] (escaping ', naturally)? Seems like it would make the code simpler, at least.

@jitter
Copy link
Contributor Author

jitter commented Dec 1, 2010

you mean like this?
...
else {
nid = nid.replace( /'/g, "$&" );
}
....
context.querySelectorAll( "[id='" + nid + "'] " + query )

This sure looks simpler. Hopefully browsers didn't just optimize for the #id syntax.

I can make a new pull request with this solution if you want.

@jeresig
Copy link
Member

jeresig commented Dec 2, 2010

Yep - like that! Also, we keep if/else braces on the same line. Thanks!

This pull request was closed.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants