Skip to content

Commit

Permalink
added some helpful print messages for devs,
Browse files Browse the repository at this point in the history
fixed an issue with text directly within body tag not rendering
  • Loading branch information
ali-thowfeek committed Feb 1, 2021
1 parent 468142c commit 5e503ae
Show file tree
Hide file tree
Showing 5 changed files with 12 additions and 4 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.2] - Feb 1, 2021
* Fixed an issue with text directly within body tag not rendering

## [3.0.0-nullsafety.1] - Feb 1, 2021
* Improved error handling

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.1"
version: "3.0.0-nullsafety.2"
sky_engine:
dependency: transitive
description: flutter
Expand Down
2 changes: 1 addition & 1 deletion example/pubspec.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -16,4 +16,4 @@ dev_dependencies:
sdk: flutter

flutter:
uses-material-design: true
uses-material-design: true
7 changes: 6 additions & 1 deletion lib/src/internals.dart
Original file line number Diff line number Diff line change
Expand Up @@ -301,7 +301,8 @@ class Parser {
event.name == 'h4' ||
event.name == 'h5' ||
event.name == 'h6' ||
event.name == 'div') {
event.name == 'div' ||
event.name == 'body') {
spans.add(TextSpan(
text: "\n\n",
));
Expand All @@ -321,6 +322,8 @@ class Parser {
print("Malformed HTML");
return;
}
} else {
print("Malformed HTML. No starting TAG");
}
}

Expand All @@ -335,6 +338,8 @@ class Parser {
//removing last textSpan to avoid extra space at the bottom
if (spans.isNotEmpty) {
spans.removeLast();
} else {
print("Empty HTML content");
}
return spans;
}
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.1
version: 3.0.0-nullsafety.2
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 5e503ae

Please sign in to comment.