Skip to content

Commit a51417f

Browse files
anny21Krinkle
authored andcommitted
Fix ParseError on CSS variable when there is no trailing semicolon
see less/less.js#3700 Bug: T386077 Change-Id: I60c0ddad9a85409b6b2ac5ecf3fab00cd8876157
1 parent 606e045 commit a51417f

File tree

3 files changed

+18
-1
lines changed

3 files changed

+18
-1
lines changed

lib/Less/Parser.php

+1-1
Original file line numberDiff line numberDiff line change
@@ -2452,7 +2452,7 @@ private function parseDeclaration() {
24522452
if ( is_array( $name ) && array_key_exists( 0, $name ) // to satisfy phan
24532453
&& $name[0] instanceof Less_Tree_Keyword
24542454
&& $name[0]->value && strpos( $name[0]->value, '--' ) === 0 ) {
2455-
$value = $this->parsePermissiveValue();
2455+
$value = $this->parsePermissiveValue( [ ';', '}' ] );
24562456
} else {
24572457
// Try to store values as anonymous
24582458
// If we need the value later we'll re-parse it in ruleset.parseValue
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
.test {
2+
--test: 38px;
3+
}
4+
@media only screen and (max-width: 1024px) {
5+
.test {
6+
--test: 38px;
7+
}
8+
}
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
.test {
2+
--test: 38px
3+
}
4+
5+
.test {
6+
@media only screen and (max-width: 1024px) {
7+
--test: 38px
8+
}
9+
}

0 commit comments

Comments
 (0)