isFenceClose function
Whether line closes open: the same character, at least as many of
them, and nothing after but whitespace.
Implementation
bool isFenceClose(String line, FenceOpen open) {
final t = line.trim();
if (t.length < open.length) {
return false;
}
for (var i = 0; i < t.length; i++) {
if (t.codeUnitAt(i) != open.fenceChar) {
return false;
}
}
return true;
}