newlines are no longer replaced with spaces in quoted strings
This commit is contained in:
parent
8f27525536
commit
29886d6845
@ -165,10 +165,14 @@ impl Value {
|
||||
let mut buf = String::with_capacity(string.len());
|
||||
for c in string.chars() {
|
||||
match c {
|
||||
'\n' => {
|
||||
buf.push(' ');
|
||||
after_newline = true;
|
||||
}
|
||||
// TODO: figure out what is going on here
|
||||
// This is adapted from the original dart-sass
|
||||
// code, but in the spec tests it seems that
|
||||
// newlines are not actually treated like this.
|
||||
// '\n' => {
|
||||
// buf.push(' ');
|
||||
// after_newline = true;
|
||||
// }
|
||||
' ' => {
|
||||
if !after_newline {
|
||||
buf.push(' ');
|
||||
|
@ -44,7 +44,12 @@ test!(
|
||||
"a {\n color: a b;\n}\n"
|
||||
);
|
||||
test!(
|
||||
interpolated_string_literally_inserted,
|
||||
interpolated_newline,
|
||||
"a {\n color: \"#{\"\\a\"}\";\n}\n",
|
||||
"a {\n color: \"\\a\";\n}\n"
|
||||
);
|
||||
test!(
|
||||
double_interpolated_newline,
|
||||
"a {\n color: \"#{#{\"\\a\"}}\";\n}\n",
|
||||
"a {\n color: \"\\a\";\n}\n"
|
||||
);
|
||||
|
Loading…
x
Reference in New Issue
Block a user