mirror of
https://github.com/danog/dart-sass.git
synced 2024-12-03 10:08:01 +01:00
Fix StringExpression.toInterpolation().
This commit is contained in:
parent
0f6f44f939
commit
dd4a9165a2
@ -42,13 +42,12 @@ class StringExpression implements Expression {
|
|||||||
/// quoted strings.
|
/// quoted strings.
|
||||||
///
|
///
|
||||||
/// If [static] is true, this escapes any `#{` sequences in the string. If
|
/// If [static] is true, this escapes any `#{` sequences in the string. If
|
||||||
/// [quote] is passed and this is a quoted string, it uses that character as
|
/// [quote] is passed, it uses that character as the quote mark; otherwise, it
|
||||||
/// the quote mark; otherwise, it determines the best quote to add by looking
|
/// determines the best quote to add by looking at the string.
|
||||||
/// at the string.
|
|
||||||
Interpolation asInterpolation({bool static: false, int quote}) {
|
Interpolation asInterpolation({bool static: false, int quote}) {
|
||||||
if (!hasQuotes) return text;
|
if (!hasQuotes) return text;
|
||||||
|
|
||||||
quote ??= hasQuotes ? null : _bestQuote();
|
quote ??= hasQuotes ? _bestQuote() : null;
|
||||||
var buffer = new InterpolationBuffer();
|
var buffer = new InterpolationBuffer();
|
||||||
if (quote != null) buffer.writeCharCode(quote);
|
if (quote != null) buffer.writeCharCode(quote);
|
||||||
for (var value in text.contents) {
|
for (var value in text.contents) {
|
||||||
|
Loading…
Reference in New Issue
Block a user