convert single quotes to double quotes in calc
This commit is contained in:
parent
7acaa94870
commit
9548eb6deb
@ -48,12 +48,12 @@ impl<'a> Parser<'a> {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
q @ '\'' | q @ '"' => {
|
q @ '\'' | q @ '"' => {
|
||||||
buf.push(q);
|
buf.push('"');
|
||||||
match self.parse_quoted_string(q)?.node {
|
match self.parse_quoted_string(q)?.node {
|
||||||
Value::String(ref s, ..) => buf.push_str(s),
|
Value::String(ref s, ..) => buf.push_str(s),
|
||||||
_ => unreachable!(),
|
_ => unreachable!(),
|
||||||
}
|
}
|
||||||
buf.push(q);
|
buf.push('"');
|
||||||
}
|
}
|
||||||
c => buf.push(c),
|
c => buf.push(c),
|
||||||
}
|
}
|
||||||
|
@ -59,6 +59,11 @@ test!(
|
|||||||
"a {\n color: calc(\")\");\n}\n",
|
"a {\n color: calc(\")\");\n}\n",
|
||||||
"a {\n color: calc(\")\");\n}\n"
|
"a {\n color: calc(\")\");\n}\n"
|
||||||
);
|
);
|
||||||
|
test!(
|
||||||
|
calc_quoted_string_single_quotes,
|
||||||
|
"a {\n color: calc('a');\n}\n",
|
||||||
|
"a {\n color: calc(\"a\");\n}\n"
|
||||||
|
);
|
||||||
test!(
|
test!(
|
||||||
element_whitespace,
|
element_whitespace,
|
||||||
"a {\n color: element( 1 );\n}\n",
|
"a {\n color: element( 1 );\n}\n",
|
||||||
|
Loading…
x
Reference in New Issue
Block a user