Skip to content

Commit 5e503ae

Browse files
committed
added some helpful print messages for devs,
fixed an issue with text directly within body tag not rendering
1 parent 468142c commit 5e503ae

File tree

5 files changed

+12
-4
lines changed

5 files changed

+12
-4
lines changed

CHANGELOG.md

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,6 @@
1+
## [3.0.0-nullsafety.2] - Feb 1, 2021
2+
* Fixed an issue with text directly within body tag not rendering
3+
14
## [3.0.0-nullsafety.1] - Feb 1, 2021
25
* Improved error handling
36

example/pubspec.lock

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -101,7 +101,7 @@ packages:
101101
path: ".."
102102
relative: true
103103
source: path
104-
version: "3.0.0-nullsafety.1"
104+
version: "3.0.0-nullsafety.2"
105105
sky_engine:
106106
dependency: transitive
107107
description: flutter

example/pubspec.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,4 +16,4 @@ dev_dependencies:
1616
sdk: flutter
1717

1818
flutter:
19-
uses-material-design: true
19+
uses-material-design: true

lib/src/internals.dart

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -301,7 +301,8 @@ class Parser {
301301
event.name == 'h4' ||
302302
event.name == 'h5' ||
303303
event.name == 'h6' ||
304-
event.name == 'div') {
304+
event.name == 'div' ||
305+
event.name == 'body') {
305306
spans.add(TextSpan(
306307
text: "\n\n",
307308
));
@@ -321,6 +322,8 @@ class Parser {
321322
print("Malformed HTML");
322323
return;
323324
}
325+
} else {
326+
print("Malformed HTML. No starting TAG");
324327
}
325328
}
326329

@@ -335,6 +338,8 @@ class Parser {
335338
//removing last textSpan to avoid extra space at the bottom
336339
if (spans.isNotEmpty) {
337340
spans.removeLast();
341+
} else {
342+
print("Empty HTML content");
338343
}
339344
return spans;
340345
}

pubspec.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
name: simple_html_css
22
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.
3-
version: 3.0.0-nullsafety.1
3+
version: 3.0.0-nullsafety.2
44
homepage: https://github.com/ali-thowfeek/simple_html_css_flutter
55
repository: https://github.com/ali-thowfeek/simple_html_css_flutter
66
environment:

0 commit comments

Comments
 (0)