Skip to content

Commit

Permalink
minor improvement
Browse files Browse the repository at this point in the history
  • Loading branch information
ali-thowfeek committed Feb 1, 2021
1 parent 176d2b0 commit 2ae61e4
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
1 change: 1 addition & 0 deletions example/lib/main.dart
Original file line number Diff line number Diff line change
Expand Up @@ -45,6 +45,7 @@ class Home extends StatelessWidget {
home: Scaffold(
appBar: AppBar(title: Text("Demo")),
body: Container(
color: Colors.white,
padding: EdgeInsets.all(16.0),
child: RichText(text: textSpan),
),
Expand Down
5 changes: 2 additions & 3 deletions lib/src/internals.dart
Original file line number Diff line number Diff line change
Expand Up @@ -302,8 +302,7 @@ class Parser {
event.name == 'h4' ||
event.name == 'h5' ||
event.name == 'h6' ||
event.name == 'div' ||
event.name == 'body') {
event.name == 'div') {
spans.add(TextSpan(
text: "\n\n",
));
Expand Down Expand Up @@ -337,7 +336,7 @@ class Parser {

//removing last textSpan to avoid extra space at the bottom
if (spans.isNotEmpty) {
spans.removeLast();
if (spans.last.text == '\n\n') spans.removeLast();
} else {
print("Empty HTML content");
}
Expand Down

0 comments on commit 2ae61e4

Please sign in to comment.