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 5e503ae commit 0b14b7c
Show file tree
Hide file tree
Showing 5 changed files with 9 additions and 6 deletions.
3 changes: 3 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,6 @@
# [3.0.0-nullsafety.3] - Feb 1, 2021
* Minor render issue fix

## [3.0.0-nullsafety.2] - Feb 1, 2021
* Fixed an issue with text directly within body tag not rendering

Expand Down
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
2 changes: 1 addition & 1 deletion example/pubspec.lock
Original file line number Diff line number Diff line change
Expand Up @@ -101,7 +101,7 @@ packages:
path: ".."
relative: true
source: path
version: "3.0.0-nullsafety.2"
version: "3.0.0-nullsafety.3"
sky_engine:
dependency: transitive
description: flutter
Expand Down
7 changes: 3 additions & 4 deletions lib/src/internals.dart
Original file line number Diff line number Diff line change
Expand Up @@ -301,8 +301,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 All @@ -323,7 +322,7 @@ class Parser {
return;
}
} else {
print("Malformed HTML. No starting TAG");
print("Malformed HTML. Starting TAG missing");
}
}

Expand All @@ -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
2 changes: 1 addition & 1 deletion pubspec.yaml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
name: simple_html_css
description: This package allows you to use simple HTML and inline CSS styles to style your text in flutter. A fork of css_text package.
version: 3.0.0-nullsafety.2
version: 3.0.0-nullsafety.3
homepage: https://github.com/ali-thowfeek/simple_html_css_flutter
repository: https://github.com/ali-thowfeek/simple_html_css_flutter
environment:
Expand Down

0 comments on commit 0b14b7c

Please sign in to comment.