Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

Added minor support for |= and ~= selectors.

  • Loading branch information...
commit e7a8310f654d5a656ebc7cec6b6480c77522bdfd 1 parent 88c88f0
John Resig jeresig authored
Showing with 2 additions and 2 deletions.
  1. +2 −2 src/selector/selector.js
4 src/selector/selector.js
View
@@ -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 );
}
Please sign in to comment.
Something went wrong with that request. Please try again.