diff --git a/src/atrule/if_rule.rs b/src/atrule/if_rule.rs index 942a6a2..b503076 100644 --- a/src/atrule/if_rule.rs +++ b/src/atrule/if_rule.rs @@ -61,7 +61,8 @@ impl If { let cond = read_until_open_curly_brace(toks); toks.next(); devour_whitespace(toks); - branches.push(Branch::new(cond, read_until_closing_curly_brace(toks))); + branches + .push(Branch::new(cond, read_until_closing_curly_brace(toks))); toks.next(); devour_whitespace(toks); } diff --git a/src/value/parse.rs b/src/value/parse.rs index 8c1e801..3818720 100644 --- a/src/value/parse.rs +++ b/src/value/parse.rs @@ -211,6 +211,7 @@ impl Value { } '!' => { toks.next(); + devour_whitespace(toks); if toks.peek().unwrap().kind == '=' { toks.next(); devour_whitespace(toks); @@ -545,6 +546,7 @@ impl Value { } '!' => { toks.next(); + devour_whitespace(toks); let v = eat_ident(toks, scope, super_selector)?; if v.to_ascii_lowercase().as_str() == "important" { Ok(Value::Important) diff --git a/tests/list.rs b/tests/list.rs index 04cd3f0..6fb5401 100644 --- a/tests/list.rs +++ b/tests/list.rs @@ -178,4 +178,4 @@ test!( removes_paren_around_item_in_list, "a {\n color: 1 (foo bar);\n}\n", "a {\n color: 1 foo bar;\n}\n" -); \ No newline at end of file +); diff --git a/tests/misc.rs b/tests/misc.rs index f8971fa..2e515db 100644 --- a/tests/misc.rs +++ b/tests/misc.rs @@ -96,3 +96,8 @@ test!( "a {\n color: inspect((((((a))))));\n}\n", "a {\n color: a;\n}\n" ); +test!( + allow_spaces_after_exclamation_point, + "a {\n color: foo ! important;\n}\n", + "a {\n color: foo !important;\n}\n" +);