Skip to content

Commit 28563bf

Browse files
committed
fixed parsing of the parent selector (<)
1 parent 1a9f6e4 commit 28563bf

File tree

2 files changed

+20
-1
lines changed

2 files changed

+20
-1
lines changed

index.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ module.exports = parse;
44

55
var re_ws = /^\s/,
66
re_name = /^(?:\\.|[\w\-\u00c0-\uFFFF])+/,
7-
re_cleanSelector = /([^\\])\s*([>~+,]|$)\s*/g,
7+
re_cleanSelector = /([^\\])\s*([><~+,]|$)\s*/g,
88
re_combinators = /^\s*[^\\]\s*[>~+,]|$\s*/g,
99
re_escape = /\\([\da-f]{1,6}\s?|(\s)|.)/ig,
1010
re_comma = /^\s*,\s*/,

tests/test.js

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -104,6 +104,25 @@ var tests = [
104104
],
105105
'sibling'
106106
],
107+
[
108+
'p < div',
109+
[
110+
[
111+
{
112+
'type': 'tag',
113+
'name': 'p'
114+
},
115+
{
116+
'type': 'parent'
117+
},
118+
{
119+
'type': 'tag',
120+
'name': 'div'
121+
}
122+
]
123+
],
124+
'parent'
125+
],
107126

108127

109128
//Escaped whitespace

0 commit comments

Comments
 (0)