aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJohn Resig <jeresig@gmail.com>2007-06-29 21:43:22 +0000
committerJohn Resig <jeresig@gmail.com>2007-06-29 21:43:22 +0000
commite7a8310f654d5a656ebc7cec6b6480c77522bdfd (patch)
tree80c95c2712abe4b2232f0671412c82f6d8843a7d
parent88c88f0704e70299cd3101a40b29cb37b79276d0 (diff)
downloadjquery-e7a8310f654d5a656ebc7cec6b6480c77522bdfd.tar.gz
jquery-e7a8310f654d5a656ebc7cec6b6480c77522bdfd.zip
Added minor support for |= and ~= selectors.
-rw-r--r--src/selector/selector.js4
1 files changed, 2 insertions, 2 deletions
diff --git a/src/selector/selector.js b/src/selector/selector.js
index 94af81e83..bc250fe85 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*\]/,
@@ -347,7 +347,7 @@ jQuery.extend({
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 == "|=" || type == "~=") && z.indexOf(m[5]) >= 0) ^ not )
tmp.push( a );
}