hexchars escaped in strings don't recieve trailing space
This commit is contained in:
parent
84b6ca9180
commit
526b4aa15f
@ -596,7 +596,7 @@ pub(crate) fn parse_quoted_string<I: Iterator<Item = Token>>(
|
|||||||
}
|
}
|
||||||
let c = std::char::from_u32(u32::from_str_radix(&n, 16).unwrap()).unwrap();
|
let c = std::char::from_u32(u32::from_str_radix(&n, 16).unwrap()).unwrap();
|
||||||
if c.is_control() && c != '\t' && c != '\0' {
|
if c.is_control() && c != '\t' && c != '\0' {
|
||||||
s.push_str(&format!("\\{} ", n.to_ascii_lowercase()));
|
s.push_str(&format!("\\{}", n.to_ascii_lowercase()));
|
||||||
} else {
|
} else {
|
||||||
s.push(c);
|
s.push(c);
|
||||||
}
|
}
|
||||||
|
@ -106,3 +106,8 @@ test!(
|
|||||||
"a {\n color: \"\\g\";\n}\n",
|
"a {\n color: \"\\g\";\n}\n",
|
||||||
"a {\n color: \"g\";\n}\n"
|
"a {\n color: \"g\";\n}\n"
|
||||||
);
|
);
|
||||||
|
test!(
|
||||||
|
escapes_hex_in_string_no_trailing_space,
|
||||||
|
"a {\n color: \"\\b\\c\\d\\e\\f\\g\\h\\i\\j\\k\\l\\m\\n\\o\\p\\q\\r\\s\\t\\u\\v\\w\\x\\y\\z\";\n}\n",
|
||||||
|
"a {\n color: \"\\b\\c\\d\\e\\fghijklmnopqrstuvwxyz\";\n}\n"
|
||||||
|
);
|
||||||
|
Loading…
x
Reference in New Issue
Block a user