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);
|
let cond = read_until_open_curly_brace(toks);
|
||||||
toks.next();
|
toks.next();
|
||||||
devour_whitespace(toks);
|
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();
|
toks.next();
|
||||||
devour_whitespace(toks);
|
devour_whitespace(toks);
|
||||||
}
|
}
|
||||||
|
@ -211,6 +211,7 @@ impl Value {
|
|||||||
}
|
}
|
||||||
'!' => {
|
'!' => {
|
||||||
toks.next();
|
toks.next();
|
||||||
|
devour_whitespace(toks);
|
||||||
if toks.peek().unwrap().kind == '=' {
|
if toks.peek().unwrap().kind == '=' {
|
||||||
toks.next();
|
toks.next();
|
||||||
devour_whitespace(toks);
|
devour_whitespace(toks);
|
||||||
@ -545,6 +546,7 @@ impl Value {
|
|||||||
}
|
}
|
||||||
'!' => {
|
'!' => {
|
||||||
toks.next();
|
toks.next();
|
||||||
|
devour_whitespace(toks);
|
||||||
let v = eat_ident(toks, scope, super_selector)?;
|
let v = eat_ident(toks, scope, super_selector)?;
|
||||||
if v.to_ascii_lowercase().as_str() == "important" {
|
if v.to_ascii_lowercase().as_str() == "important" {
|
||||||
Ok(Value::Important)
|
Ok(Value::Important)
|
||||||
|
@ -96,3 +96,8 @@ test!(
|
|||||||
"a {\n color: inspect((((((a))))));\n}\n",
|
"a {\n color: inspect((((((a))))));\n}\n",
|
||||||
"a {\n color: 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