This commit is contained in:
ConnorSkees 2020-05-24 13:50:45 -04:00
parent b5c1fb2013
commit 812e9fec9c
6 changed files with 11 additions and 16 deletions

View File

@ -628,7 +628,10 @@ impl Value {
Self::Dimension(num, unit).div(other.eval(span)?.node, span)?
}
Self::List(..) | Self::True | Self::False | Self::Important | Self::Color(..) => {
Value::String(format!("{}{}/{}", num, unit, other.to_css_string(span)?), QuoteKind::None)
Value::String(
format!("{}{}/{}", num, unit, other.to_css_string(span)?),
QuoteKind::None,
)
}
Self::Null => Value::String(format!("{}{}/", num, unit), QuoteKind::None),
Self::Map(..) | Self::Function(..) => {

View File

@ -601,7 +601,8 @@ impl Value {
"url" => match try_eat_url(toks, scope, super_selector)? {
Some(val) => s = val,
None => s.push_str(
&eat_call_args(toks, pos)?.to_css_string(scope, super_selector)?,
&eat_call_args(toks, pos)?
.to_css_string(scope, super_selector)?,
),
},
_ => s.push_str(

View File

@ -49,6 +49,5 @@ test!(
// and should be "expected \")\"."
error!(
nothing_after_open,
"a { color:rgb(; }",
"Error: expected \"{\"."
"a { color:rgb(; }", "Error: expected \"{\"."
);

View File

@ -65,8 +65,7 @@ test!(
);
error!(
num_div_map,
"a {\n color: 1 / (a: b);\n}\n",
"Error: (a: b) isn't a valid CSS value."
"a {\n color: 1 / (a: b);\n}\n", "Error: (a: b) isn't a valid CSS value."
);
error!(
num_div_function,

View File

@ -549,7 +549,4 @@ error!(
non_ident_char_after_colon,
":#ab {}", "Error: Expected identifier."
);
error!(
nothing_after_colon,
"a:{}", "Error: Expected identifier."
);
error!(nothing_after_colon, "a:{}", "Error: Expected identifier.");

View File

@ -15,8 +15,4 @@ test!(
"@#{()if(0,0<0,0)}",
"@false;\n"
);
test!(
nothing_after_hash,
"@foo #",
"@foo #;\n"
);
test!(nothing_after_hash, "@foo #", "@foo #;\n");