allow whitespace between ! and important
This commit is contained in:
parent
faf9cf8818
commit
978fbaade0
@ -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);
|
||||
}
|
||||
|
@ -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)
|
||||
|
@ -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"
|
||||
);
|
||||
);
|
||||
|
@ -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"
|
||||
);
|
||||
|
Loading…
x
Reference in New Issue
Block a user