diff options
author | John Resig <jeresig@gmail.com> | 2010-10-12 09:19:49 -0400 |
---|---|---|
committer | John Resig <jeresig@gmail.com> | 2010-10-12 09:19:49 -0400 |
commit | 5200194f517a7bde7bbe9aa50dc1e81f1e1db441 (patch) | |
tree | e585b0dcfe6e5f25d856f3f52b87bf2eefd311fc /src/traversing.js | |
parent | ff6ceadbfd470463e63708413eb5a55bd7e90c69 (diff) | |
download | jquery-5200194f517a7bde7bbe9aa50dc1e81f1e1db441.tar.gz jquery-5200194f517a7bde7bbe9aa50dc1e81f1e1db441.zip |
Make sure that .find() with multiple direct child selectors is handled correctly. Fixes #7144.
Diffstat (limited to 'src/traversing.js')
-rw-r--r-- | src/traversing.js | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/src/traversing.js b/src/traversing.js index 5a479f2ef..968aab036 100644 --- a/src/traversing.js +++ b/src/traversing.js @@ -4,7 +4,7 @@ var runtil = /Until$/, rparentsprev = /^(?:parents|prevUntil|prevAll)/, // Note: This RegExp should be improved, or likely pulled from Sizzle rmultiselector = /,/, - rchild = /^\s*>/, + rchild = /(^|,)\s*>/g, isSimple = /^.[^:#\[\.,]*$/, slice = Array.prototype.slice, POS = jQuery.expr.match.POS; @@ -13,7 +13,7 @@ jQuery.fn.extend({ find: function( selector ) { // Handle "> div" child selectors and pass them to .children() if ( typeof selector === "string" && rchild.test( selector ) ) { - return this.children( selector.replace( rchild, "" ) ); + return this.children( selector.replace( rchild, "$1" ) ); } var ret = this.pushStack( "", "find", selector ), length = 0; |