mirror of
https://github.com/danog/dart-sass.git
synced 2024-12-02 17:49:38 +01:00
Fix unquoted string serialization again.
This commit is contained in:
parent
0a6ebc6f8c
commit
99e0a1100f
@ -604,15 +604,22 @@ class _SerializeCssVisitor
|
|||||||
|
|
||||||
/// Writes an unquoted string with [string] contents to [_buffer].
|
/// Writes an unquoted string with [string] contents to [_buffer].
|
||||||
void _visitUnquotedString(String string) {
|
void _visitUnquotedString(String string) {
|
||||||
|
var afterNewline = false;
|
||||||
for (var i = 0; i < string.length; i++) {
|
for (var i = 0; i < string.length; i++) {
|
||||||
var char = string.codeUnitAt(i);
|
var char = string.codeUnitAt(i);
|
||||||
switch (char) {
|
switch (char) {
|
||||||
case $lf:
|
case $lf:
|
||||||
_buffer.writeCharCode($space);
|
_buffer.writeCharCode($space);
|
||||||
|
afterNewline = true;
|
||||||
|
break;
|
||||||
|
|
||||||
|
case $space:
|
||||||
|
if (!afterNewline) _buffer.writeCharCode($space);
|
||||||
break;
|
break;
|
||||||
|
|
||||||
default:
|
default:
|
||||||
_buffer.writeCharCode(char);
|
_buffer.writeCharCode(char);
|
||||||
|
afterNewline = false;
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user