mirror of
https://github.com/danog/dart-sass.git
synced 2024-11-27 04:34:59 +01:00
Fix newlines in interpolation. (#73)
This commit is contained in:
parent
b4730dd6a6
commit
9fdc8194fd
@ -11,6 +11,8 @@
|
||||
* `str-slice()` now correctly returns `""` when `$end-at` is negative and points
|
||||
before the beginning of the string.
|
||||
|
||||
* Interpolation in quoted strings now properly preserves newlines.
|
||||
|
||||
* Don't crash when passing only `$hue` or no keyword arguments to
|
||||
`adjust-color()`, `scale-color()`, or `change-color()`.
|
||||
|
||||
|
@ -1293,8 +1293,19 @@ class _PerformVisitor
|
||||
return selector.value.asSassList;
|
||||
}
|
||||
|
||||
SassString visitStringExpression(StringExpression node) =>
|
||||
new SassString(_performInterpolation(node.text), quotes: node.hasQuotes);
|
||||
SassString visitStringExpression(StringExpression node) {
|
||||
// Don't use [performInterpolation] here because we need to get the raw text
|
||||
// from strings.
|
||||
return new SassString(
|
||||
node.text.contents.map((value) {
|
||||
if (value is String) return value;
|
||||
var result = (value as Expression).accept(this);
|
||||
return result is SassString
|
||||
? result.text
|
||||
: result.toCssString(quote: false);
|
||||
}).join(),
|
||||
quotes: node.hasQuotes);
|
||||
}
|
||||
|
||||
// ## Utilities
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user