Skip to content

Commit f8cb452

Browse files
committed
Version 0.9.6
1 parent 90c0daa commit f8cb452

File tree

4 files changed

+11
-7
lines changed

4 files changed

+11
-7
lines changed

CHANGELOG.md

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,7 @@
1+
## [0.9.6] - March 11, 2019:
2+
3+
* Fix whitespace issue. ([#59](https://github.com/Sub6Resources/flutter_html/issues/59))
4+
15
## [0.9.5] - March 11, 2019:
26

37
* Add support for `span` in `RichText` parser. ([#61](https://github.com/Sub6Resources/flutter_html/issues/61))

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ A Flutter widget for rendering static html tags as Flutter widgets. (Will render
99
Add the following to your `pubspec.yaml` file:
1010

1111
dependencies:
12-
flutter_html: ^0.9.5
12+
flutter_html: ^0.9.6
1313

1414
## Currently Supported HTML Tags:
1515
`a`, `abbr`, `acronym`, `address`, `article`, `aside`, `b`, `bdi`, `bdo`, `big`, `blockquote`, `body`, `br`, `caption`, `cite`, `code`, `data`, `dd`, `del`, `dfn`, `div`, `dl`, `dt`, `em`, `figcaption`, `figure`, `footer`, `h1`, `h2`, `h3`, `h4`, `h5`, `h6`, `header`, `hr`, `i`, `img`, `ins`, `kbd`, `li`, `main`, `mark`, `nav`, `noscript`, `ol`, `p`, `pre`, `q`, `rp`, `rt`, `ruby`, `s`, `samp`, `section`, `small`, `span`, `strike`, `strong`, `sub`, `sup`, `table`, `tbody`, `td`, `template`, `tfoot`, `th`, `thead`, `time`, `tr`, `tt`, `u`, `ul`, `var`

lib/html_parser.dart

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -329,14 +329,14 @@ class HtmlRichTextParser extends StatelessWidget {
329329
if (!parseContext.parentElement.children.isEmpty) {
330330
lastString = parseContext.parentElement.children.last.text ?? '';
331331
}
332-
if (lastString == '' ||
333-
lastString.endsWith(' ') ||
334-
lastString.endsWith('\n')) finalText = finalText.trimLeft();
332+
if (lastString.endsWith(' ') || lastString.endsWith('\n')) {
333+
finalText = finalText.trimLeft();
334+
}
335335
}
336336
}
337337

338-
// if the finalText is actually empty, just return
339-
if (finalText.trim().isEmpty) return;
338+
// if the finalText is actually empty, just return (unless it's just a space)
339+
if (finalText.trim().isEmpty && finalText != " ") return;
340340

341341
// NOW WE HAVE OUR TRULY FINAL TEXT
342342
// debugPrint("Plain Text Node: '$finalText'");

pubspec.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
name: flutter_html
22
description: A Flutter widget for rendering static html tags as Flutter widgets. (Will render over 70 different html tags!)
3-
version: 0.9.5
3+
version: 0.9.6
44
author: Matthew Whitaker <sub6resources@gmail.com>
55
homepage: https://github.com/Sub6Resources/flutter_html
66

0 commit comments

Comments
 (0)