simplified code across the app and consolidated duplicated helpers

This commit is contained in:
2026-09-27 17:29:54 +02:00
parent 3e856d0b1c
commit ee1240f71a
155 changed files with 1772 additions and 2546 deletions
+3 -1
View File
@@ -53,9 +53,11 @@ String markdownToPlainText(String source) {
final buffer = StringBuffer();
_collect(nodes, buffer);
return buffer.toString().replaceAll(RegExp(r'\s+'), ' ').trim();
return buffer.toString().replaceAll(_whitespace, ' ').trim();
}
final _whitespace = RegExp(r'\s+');
void _collect(List<md.Node> nodes, StringBuffer buffer) {
for (final node in nodes) {
if (node is md.Text) {