fix(compiler): have CSS parser support nested parentheses inside functions
Closes #7580
This commit is contained in:
committed by
Misko Hevery
parent
4d6da7b1a7
commit
ceac045a7f
@@ -459,8 +459,14 @@ export class CssScanner {
|
||||
scanCssValueFunction(): CssToken {
|
||||
var start = this.index;
|
||||
var startingColumn = this.column;
|
||||
while (this.peek != $EOF && this.peek != $RPAREN) {
|
||||
var parenBalance = 1;
|
||||
while (this.peek != $EOF && parenBalance > 0) {
|
||||
this.advance();
|
||||
if (this.peek == $LPAREN) {
|
||||
parenBalance++;
|
||||
} else if (this.peek == $RPAREN) {
|
||||
parenBalance--;
|
||||
}
|
||||
}
|
||||
var strValue = this.input.substring(start, this.index);
|
||||
return new CssToken(start, startingColumn, this.line, CssTokenType.Identifier, strValue);
|
||||
|
||||
Reference in New Issue
Block a user