Skip to content

Commit 0b14b7c

Browse files
committed
minor improvement
1 parent 5e503ae commit 0b14b7c

File tree

5 files changed

+9
-6
lines changed

5 files changed

+9
-6
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.3] - Feb 1, 2021
2+
* Minor render issue fix
3+
14
## [3.0.0-nullsafety.2] - Feb 1, 2021
25
* Fixed an issue with text directly within body tag not rendering
36

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
),

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.2"
104+
version: "3.0.0-nullsafety.3"
105105
sky_engine:
106106
dependency: transitive
107107
description: flutter

lib/src/internals.dart

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -301,8 +301,7 @@ class Parser {
301301
event.name == 'h4' ||
302302
event.name == 'h5' ||
303303
event.name == 'h6' ||
304-
event.name == 'div' ||
305-
event.name == 'body') {
304+
event.name == 'div') {
306305
spans.add(TextSpan(
307306
text: "\n\n",
308307
));
@@ -323,7 +322,7 @@ class Parser {
323322
return;
324323
}
325324
} else {
326-
print("Malformed HTML. No starting TAG");
325+
print("Malformed HTML. Starting TAG missing");
327326
}
328327
}
329328

@@ -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
}

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.2
3+
version: 3.0.0-nullsafety.3
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)