X-Git-Url: http://git.asbjorn.biz/?a=blobdiff_plain;f=src%2Fselector%2Fselector.js;h=5f6f87b0460965522b19dca45256c1aeddb19968;hb=fa7bfcfd783421b561bccb5c9402e0993b4af769;hp=94af81e8358a746d5a169627eae57f4ab2e442ba;hpb=88c88f0704e70299cd3101a40b29cb37b79276d0;p=jquery.git diff --git a/src/selector/selector.js b/src/selector/selector.js index 94af81e..5f6f87b 100644 --- a/src/selector/selector.js +++ b/src/selector/selector.js @@ -53,7 +53,7 @@ jQuery.extend({ // The regular expressions that power the parsing engine parse: [ // Match: [@value='test'], [@foo] - /^\[ *(@)([\w-]+) *([!*$^=]*) *('?"?)(.*?)\4 *\]/, + /^\[ *(@)([\w-]+) *([!*$^~=]*) *('?"?)(.*?)\4 *\]/, // Match: [div], [div p] /^(\[)\s*(.*?(\[.*?\])?[^[]*?)\s*\]/, @@ -340,14 +340,14 @@ jQuery.extend({ var a = r[i], z = a[ jQuery.props[m[2]] || m[2] ]; if ( z == null || /href|src/.test(m[2]) ) - z = jQuery.attr(a,m[2]); + z = jQuery.attr(a,m[2]) || ''; if ( (type == "" && !!z || type == "=" && z == m[5] || type == "!=" && z != m[5] || type == "^=" && z && !z.indexOf(m[5]) || type == "$=" && z.substr(z.length - m[5].length) == m[5] || - type == "*=" && z.indexOf(m[5]) >= 0) ^ not ) + (type == "*=" || type == "~=") && z.indexOf(m[5]) >= 0) ^ not ) tmp.push( a ); }