diff options
Diffstat (limited to 'src/core.js')
-rw-r--r-- | src/core.js | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/src/core.js b/src/core.js index 8d812e384..6ab06e15b 100644 --- a/src/core.js +++ b/src/core.js @@ -96,9 +96,10 @@ jQuery.fn = jQuery.prototype = { // Handle HTML strings if ( typeof selector === "string" ) { // Are we dealing with HTML string or an ID? - if ( selector.length > 1024 ) { - // Assume very large strings are HTML and skip the regex check + if ( selector.charAt(0) === "<" || selector.charAt( selector.length - 1 ) === ">" ) { + // Assume that strings that start and end with <> are HTML and skip the regex check match = [ null, selector, null ]; + } else { match = quickExpr.exec( selector ); } |