File tree Expand file tree Collapse file tree 2 files changed +24
-1
lines changed Expand file tree Collapse file tree 2 files changed +24
-1
lines changed Original file line number Diff line number Diff line change @@ -113,6 +113,13 @@ function attributeMatch(match, content) {
113113 } ) ;
114114}
115115
116+ function invalidMatch ( match ) {
117+ this . selector . nodes . push ( {
118+ type : "invalid" ,
119+ value : match
120+ } ) ;
121+ }
122+
116123function irrelevantSpacingStartMatch ( match ) {
117124 this . selector . before = match ;
118125}
@@ -171,7 +178,8 @@ var parser = new Parser({
171178 "(\\s*),(\\s*)" : nextSelectorMatch ,
172179 "\\s+$" : irrelevantSpacingEndMatch ,
173180 "^\\s+" : irrelevantSpacingStartMatch ,
174- "\\s+" : spacingMatch
181+ "\\s+" : spacingMatch ,
182+ "." : invalidMatch
175183 } ,
176184 inBrackets : {
177185 "/\\*[\\s\\S]*?\\*/" : addToCurrent ,
Original file line number Diff line number Diff line change @@ -300,6 +300,21 @@ module.exports = {
300300 ] )
301301 ] ,
302302
303+ "invalid chars" : [
304+ "a'b/c\"d[e" ,
305+ singleSelector ( [
306+ { type : "element" , name : "a" } ,
307+ { type : "invalid" , value : "'" } ,
308+ { type : "element" , name : "b" } ,
309+ { type : "invalid" , value : "/" } ,
310+ { type : "element" , name : "c" } ,
311+ { type : "invalid" , value : "\"" } ,
312+ { type : "element" , name : "d" } ,
313+ { type : "invalid" , value : "[" } ,
314+ { type : "element" , name : "e" }
315+ ] )
316+ ] ,
317+
303318 "invalid nesting" : [
304319 "a ) b" ,
305320 singleSelector ( [
You can’t perform that action at this time.
0 commit comments