Fix "Value not in range: -1" error

Fixes #4
This commit is contained in:
Vishesh Handa
2019-05-29 17:34:47 +02:00
parent 0cf647e1b6
commit 3fd801b4a1

View File

@ -25,7 +25,10 @@ class MarkdownBuilder implements md.NodeVisitor {
});
var str = stringBuffer.toString();
return str.substring(0, str.length - 1);
if (str.isNotEmpty) {
return str.substring(0, str.length - 1);
}
return str;
}
@override