Handle no space between colon when also missing semicolon
This commit is contained in:
parent
b8bacbde8b
commit
bad318aae8
@ -527,6 +527,14 @@ pub(crate) fn eat_expr<I: Iterator<Item = Token>>(
|
||||
toks.next();
|
||||
devour_whitespace(toks);
|
||||
return Ok(None);
|
||||
} else {
|
||||
// special edge case where there was no space between the colon
|
||||
// and no semicolon following the style
|
||||
// in a style `color:red`. todo: refactor
|
||||
let mut v = values.clone().into_iter().peekable();
|
||||
let property = Style::parse_property(&mut v, scope, super_selector, String::new());
|
||||
let value = Style::parse_value(&mut v, scope, super_selector);
|
||||
return Ok(Some(Expr::Style(Style { property, value })));
|
||||
}
|
||||
}
|
||||
TokenKind::Symbol(Symbol::OpenCurlyBrace) => {
|
||||
|
@ -125,3 +125,8 @@ test!(
|
||||
"a {\n color:red;\n}\n",
|
||||
"a {\n color: red;\n}\n"
|
||||
);
|
||||
test!(
|
||||
no_space_between_colon_no_semicolon,
|
||||
"a {\n color:red\n}\n",
|
||||
"a {\n color: red;\n}\n"
|
||||
);
|
||||
|
Loading…
x
Reference in New Issue
Block a user