bbef9b8276e346a0caaaf9953e0d6ebedd814b73af184ba58789b5231819cadc2eaf12dd55c8f7f94ac1ee991f1b0ec0966f52181ca0996bc5b07c522edcfb 773 B

12345678910111213141516171819202122232425262728293031
  1. define( [
  2. "../core"
  3. ], function( jQuery ) {
  4. "use strict";
  5. // CSS string/identifier serialization
  6. // https://drafts.csswg.org/cssom/#common-serializing-idioms
  7. var rcssescape = /([\0-\x1f\x7f]|^-?\d)|^-$|[^\x80-\uFFFF\w-]/g;
  8. function fcssescape( ch, asCodePoint ) {
  9. if ( asCodePoint ) {
  10. // U+0000 NULL becomes U+FFFD REPLACEMENT CHARACTER
  11. if ( ch === "\0" ) {
  12. return "\uFFFD";
  13. }
  14. // Control characters and (dependent upon position) numbers get escaped as code points
  15. return ch.slice( 0, -1 ) + "\\" + ch.charCodeAt( ch.length - 1 ).toString( 16 ) + " ";
  16. }
  17. // Other potentially-special ASCII characters get backslash-escaped
  18. return "\\" + ch;
  19. }
  20. jQuery.escapeSelector = function( sel ) {
  21. return ( sel + "" ).replace( rcssescape, fcssescape );
  22. };
  23. } );