diff --git a/src/lib.rs b/src/lib.rs index aba7c2f..3de7201 100644 --- a/src/lib.rs +++ b/src/lib.rs @@ -527,6 +527,14 @@ pub(crate) fn eat_expr>( 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) => { diff --git a/tests/styles.rs b/tests/styles.rs index abae804..8e0369d 100644 --- a/tests/styles.rs +++ b/tests/styles.rs @@ -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" +);