mirror of
https://github.com/less/less.js.git
synced 2026-01-08 23:28:04 -05:00
fix(parser): fix crash when css variable property does not end with a semicolon (#3700)
Fixes #3698 #3373
This commit is contained in:
@@ -1551,7 +1551,7 @@ const Parser = function Parser(context, imports, fileInfo) {
|
||||
|
||||
// Custom property values get permissive parsing
|
||||
if (name[0].value && name[0].value.slice(0, 2) === '--') {
|
||||
value = this.permissiveValue();
|
||||
value = this.permissiveValue(/[;}]/);
|
||||
}
|
||||
// Try to store values as anonymous
|
||||
// If we need the value later we'll re-parse it in ruleset.parseValue
|
||||
|
||||
@@ -35,3 +35,12 @@ foo[attr="blah"] {
|
||||
--value: a /* { ; } */;
|
||||
--comment-within: ( /* okay?; comment; */ );
|
||||
}
|
||||
.test-no-trailing-semicolon {
|
||||
--value: foo;
|
||||
}
|
||||
.test-no-trailing-semicolon2 {
|
||||
--value: foo;
|
||||
}
|
||||
.test-no-trailing-semicolon3 {
|
||||
--value: foo;
|
||||
}
|
||||
|
||||
@@ -47,4 +47,9 @@
|
||||
.test-rule-comment {
|
||||
--value: a/* { ; } */;
|
||||
--comment-within: ( /* okay?; comment; */ );
|
||||
}
|
||||
}
|
||||
.test-no-trailing-semicolon {
|
||||
--value: foo
|
||||
}
|
||||
.test-no-trailing-semicolon2 {--value: foo}
|
||||
.test-no-trailing-semicolon3 { --value: foo }
|
||||
|
||||
Reference in New Issue
Block a user