Skip to content

Commit 2ae61e4

Browse files
committed
minor improvement
1 parent 176d2b0 commit 2ae61e4

File tree

2 files changed

+3
-3
lines changed

2 files changed

+3
-3
lines changed

example/lib/main.dart

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -45,6 +45,7 @@ class Home extends StatelessWidget {
4545
home: Scaffold(
4646
appBar: AppBar(title: Text("Demo")),
4747
body: Container(
48+
color: Colors.white,
4849
padding: EdgeInsets.all(16.0),
4950
child: RichText(text: textSpan),
5051
),

lib/src/internals.dart

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -302,8 +302,7 @@ class Parser {
302302
event.name == 'h4' ||
303303
event.name == 'h5' ||
304304
event.name == 'h6' ||
305-
event.name == 'div' ||
306-
event.name == 'body') {
305+
event.name == 'div') {
307306
spans.add(TextSpan(
308307
text: "\n\n",
309308
));
@@ -337,7 +336,7 @@ class Parser {
337336

338337
//removing last textSpan to avoid extra space at the bottom
339338
if (spans.isNotEmpty) {
340-
spans.removeLast();
339+
if (spans.last.text == '\n\n') spans.removeLast();
341340
} else {
342341
print("Empty HTML content");
343342
}

0 commit comments

Comments
 (0)