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());
|
let mut buf = String::with_capacity(string.len());
|
||||||
for c in string.chars() {
|
for c in string.chars() {
|
||||||
match c {
|
match c {
|
||||||
'\n' => {
|
// TODO: figure out what is going on here
|
||||||
buf.push(' ');
|
// This is adapted from the original dart-sass
|
||||||
after_newline = true;
|
// 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 {
|
if !after_newline {
|
||||||
buf.push(' ');
|
buf.push(' ');
|
||||||
|
@ -44,7 +44,12 @@ test!(
|
|||||||
"a {\n color: a b;\n}\n"
|
"a {\n color: a b;\n}\n"
|
||||||
);
|
);
|
||||||
test!(
|
test!(
|
||||||
interpolated_string_literally_inserted,
|
interpolated_newline,
|
||||||
"a {\n color: \"#{\"\\a\"}\";\n}\n",
|
"a {\n color: \"#{\"\\a\"}\";\n}\n",
|
||||||
"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