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鈥檒l occasionally send you account related emails.

Already on GitHub? Sign in to your account

Selector: Introduce Sizzle.escape #364

Closed
wants to merge 5 commits into from
Closed

Conversation

Copy link
Member

@gibson042 gibson042 commented Nov 9, 2015

SemVer minor
Fixes gh-363
Ref jquery/jquery#1761

Deviates from the spec in allowing NULL input, but attempts to justify it. 馃槈

   raw     gz Sizes                                                            
 61892  18691 dist/sizzle.js                                                   
 18995   7169 dist/sizzle.min.js                                               

   raw     gz Compared to master @ cfc50b37e81a3453c4f0a5d2eac3f98f9009ce1b    
  +639   +247 dist/sizzle.js                                                   
  +141    +49 dist/sizzle.min.js                                               

//}
if ( numeric ) {
// Code-point-escape the offending character, preserving any non-escaped prefix
return ch.slice( 0, -1 ) + "\\" + ch.charCodeAt( ch.length - 1 ).toString( 16 ) + " ";
Copy link
Member

@timmywil timmywil Nov 9, 2015

Choose a reason for hiding this comment

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

What's the added space?

Copy link
Member Author

@gibson042 gibson042 Nov 9, 2015

Choose a reason for hiding this comment

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

It is necessary to set the escape sequence apart from following hexadecimal characters (e.g., so "a.b" gets escaped as a\2e b instead of a\2eb, which corresponds to "a双"). See https://drafts.csswg.org/cssom/#escape-a-character-as-code-point .

Copy link
Member

@timmywil timmywil Nov 9, 2015

Choose a reason for hiding this comment

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

I see. Thanks.

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

5 participants