Skip to content
This repository

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse code

Added minor support for |= and ~= selectors.

  • Loading branch information...
commit e7a8310f654d5a656ebc7cec6b6480c77522bdfd 1 parent 88c88f0
John Resig jeresig authored

Showing 1 changed file with 2 additions and 2 deletions. Show diff stats Hide diff stats

  1. +2 2 src/selector/selector.js
4 src/selector/selector.js
@@ -53,7 +53,7 @@ jQuery.extend({
53 53 // The regular expressions that power the parsing engine
54 54 parse: [
55 55 // Match: [@value='test'], [@foo]
56   - /^\[ *(@)([\w-]+) *([!*$^=]*) *('?"?)(.*?)\4 *\]/,
  56 + /^\[ *(@)([\w-]+) *([!*$^~|=]*) *('?"?)(.*?)\4 *\]/,
57 57
58 58 // Match: [div], [div p]
59 59 /^(\[)\s*(.*?(\[.*?\])?[^[]*?)\s*\]/,
@@ -347,7 +347,7 @@ jQuery.extend({
347 347 type == "!=" && z != m[5] ||
348 348 type == "^=" && z && !z.indexOf(m[5]) ||
349 349 type == "$=" && z.substr(z.length - m[5].length) == m[5] ||
350   - type == "*=" && z.indexOf(m[5]) >= 0) ^ not )
  350 + (type == "*=" || type == "|=" || type == "~=") && z.indexOf(m[5]) >= 0) ^ not )
351 351 tmp.push( a );
352 352 }
353 353

0 comments on commit e7a8310

Please sign in to comment.
Something went wrong with that request. Please try again.