Skip to content

Commit

Permalink
Added minor support for |= and ~= selectors.
Browse files Browse the repository at this point in the history
  • Loading branch information
jeresig committed Jun 29, 2007
1 parent 88c88f0 commit e7a8310
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/selector/selector.js
Expand Up @@ -53,7 +53,7 @@ jQuery.extend({
// The regular expressions that power the parsing engine // The regular expressions that power the parsing engine
parse: [ parse: [
// Match: [@value='test'], [@foo] // Match: [@value='test'], [@foo]
/^\[ *(@)([\w-]+) *([!*$^=]*) *('?"?)(.*?)\4 *\]/, /^\[ *(@)([\w-]+) *([!*$^~|=]*) *('?"?)(.*?)\4 *\]/,


// Match: [div], [div p] // Match: [div], [div p]
/^(\[)\s*(.*?(\[.*?\])?[^[]*?)\s*\]/, /^(\[)\s*(.*?(\[.*?\])?[^[]*?)\s*\]/,
Expand Down Expand Up @@ -347,7 +347,7 @@ jQuery.extend({
type == "!=" && z != m[5] || type == "!=" && z != m[5] ||
type == "^=" && z && !z.indexOf(m[5]) || type == "^=" && z && !z.indexOf(m[5]) ||
type == "$=" && z.substr(z.length - m[5].length) == 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 ); tmp.push( a );
} }


Expand Down

0 comments on commit e7a8310

Please sign in to comment.