diff --git a/src/parse/value/css_function.rs b/src/parse/value/css_function.rs index fe90a18..5d60c3b 100644 --- a/src/parse/value/css_function.rs +++ b/src/parse/value/css_function.rs @@ -48,12 +48,12 @@ impl<'a> Parser<'a> { } } q @ '\'' | q @ '"' => { - buf.push(q); + buf.push('"'); match self.parse_quoted_string(q)?.node { Value::String(ref s, ..) => buf.push_str(s), _ => unreachable!(), } - buf.push(q); + buf.push('"'); } c => buf.push(c), } diff --git a/tests/special-functions.rs b/tests/special-functions.rs index 9511465..5f22f5f 100644 --- a/tests/special-functions.rs +++ b/tests/special-functions.rs @@ -59,6 +59,11 @@ test!( "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!( element_whitespace, "a {\n color: element( 1 );\n}\n",