Skip to content

Commit 52376e5

Browse files
committed
removed whitespace at beginning of block elements
1 parent b57450b commit 52376e5

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

lib/html_parser.dart

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -318,8 +318,9 @@ class HtmlRichTextParser extends StatelessWidget {
318318
if (!parseContext.parentElement.children.isEmpty) {
319319
lastString = parseContext.parentElement.children.last.text;
320320
}
321-
if (lastString.endsWith(' ') || lastString.endsWith('\n'))
322-
finalText = finalText.trimLeft();
321+
if (lastString == '' ||
322+
lastString.endsWith(' ') ||
323+
lastString.endsWith('\n')) finalText = finalText.trimLeft();
323324
}
324325

325326
// if the finalText is actually empty, just return

0 commit comments

Comments
 (0)