Don't add */ for indented syntax loud comments that already have it

This commit is contained in:
Natalie Weizenbaum 2018-02-23 16:45:32 -08:00
parent bacc380d5b
commit 7454a1b57f
3 changed files with 7 additions and 1 deletions

View File

@ -2,6 +2,9 @@
* Don't deadlock on `/*` comments in the indented syntax.
* Don't add an extra `*/` to comments in the indented syntax that already have
it.
## 1.0.0-beta.5.2
* Fix a bug where some colors would crash `compressed` mode.

View File

@ -23,6 +23,9 @@ class InterpolationBuffer implements StringSink {
/// Returns whether this buffer has no contents.
bool get isEmpty => _contents.isEmpty && _text.isEmpty;
/// Returns the substring of the buffer string after the last interpolation.
String get trailingString => _text.toString();
/// Empties this buffer.
void clear() {
_contents.clear();

View File

@ -244,7 +244,7 @@ class SassParser extends StylesheetParser {
if (_peekIndentation() <= parentIndentation) break;
_readIndentation();
}
buffer.write(" */");
if (!buffer.trailingString.trimRight().endsWith("*/")) buffer.write(" */");
return new LoudComment(buffer.interpolation(scanner.spanFrom(start)));
}