Skip to content

Commit

Permalink
Merge pull request #15 from pigshell/icontains
Browse files Browse the repository at this point in the history
The :icontains selector also needs to be stripped of quotes.
  • Loading branch information
fb55 committed Oct 30, 2015
2 parents 3083ac0 + 79ff889 commit 659b936
Show file tree
Hide file tree
Showing 2 changed files with 28 additions and 1 deletion.
3 changes: 2 additions & 1 deletion index.js
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,8 @@ var unpackPseudos = {

var stripQuotesFromPseudos = {
__proto__: null,
"contains": true
"contains": true,
"icontains": true
};

var quotes = {
Expand Down
26 changes: 26 additions & 0 deletions tests/test.js
Original file line number Diff line number Diff line change
Expand Up @@ -353,6 +353,32 @@ var tests = [
],
"pseudo selector with data"
],
[
":icontains('')",
[
[
{
"type": "pseudo",
"name": "icontains",
"data": ""
}
]
],
"pseudo selector with quote-stripped data"
],
[
":contains(\"(foo)\")",
[
[
{
"type": "pseudo",
"name": "contains",
"data": "(foo)"
}
]
],
"pseudo selector with data"
],

//multiple selectors
[
Expand Down

0 comments on commit 659b936

Please sign in to comment.