Fix a _minimumIndentation() edge case (#218)

This commit is contained in:
Natalie Weizenbaum 2018-01-21 13:14:44 -08:00 committed by GitHub
parent 67494e2b2a
commit 116bd3a8af
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -284,7 +284,7 @@ class _SerializeVisitor implements CssVisitor, ValueVisitor, SelectorVisitor {
int _minimumIndentation(String text) {
var scanner = new LineScanner(text);
while (!scanner.isDone && scanner.readChar() != $lf) {}
if (scanner.isDone) return null;
if (scanner.isDone) return scanner.peekChar(-1) == $lf ? -1 : null;
int min;
while (!scanner.isDone) {