Skip to content

Commit 83c43b2

Browse files
committed
Merge pull request #100 from mattiacci/ident-underscore
Allow underscores in identifiers
2 parents bf127a9 + a0966ec commit 83c43b2

File tree

2 files changed

+3
-2
lines changed

2 files changed

+3
-2
lines changed

src/css/PropertyValuePart.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -149,7 +149,7 @@ function PropertyValuePart(text, line, col){
149149
} else if (/^[\,\/]$/.test(text)){
150150
this.type = "operator";
151151
this.value = text;
152-
} else if (/^[a-z\-\u0080-\uFFFF][a-z0-9\-\u0080-\uFFFF]*$/i.test(text)){
152+
} else if (/^[a-z\-_\u0080-\uFFFF][a-z0-9\-_\u0080-\uFFFF]*$/i.test(text)){
153153
this.type = "identifier";
154154
this.value = text;
155155
}

tests/css/Validation.js

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -69,7 +69,8 @@
6969
"foo",
7070
"foo, bar",
7171
"none, none",
72-
"none, foo"
72+
"none, foo",
73+
"has_underscore"
7374
],
7475

7576
invalid: {

0 commit comments

Comments
 (0)