Skip to content

Commit

Permalink
Version 0.5.3
Browse files Browse the repository at this point in the history
  • Loading branch information
Sub6Resources committed Aug 26, 2018
1 parent f5081f2 commit 88c3568
Show file tree
Hide file tree
Showing 4 changed files with 29 additions and 4 deletions.
4 changes: 4 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,7 @@
## [0.5.3] - August 25, 2018:

* Adds support for `strike`, and `tt`.

## [0.5.2] - August 25, 2018:

* Adds support for `bdi` and `bdo`
Expand Down
7 changes: 4 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ A Flutter widget for rendering static html tags as Flutter widgets. (Will render
Add the following to your `pubspec.yaml` file:

dependencies:
flutter_html: ^0.5.2
flutter_html: ^0.5.3

## Currently Supported HTML Tags:

Expand Down Expand Up @@ -64,6 +64,7 @@ Add the following to your `pubspec.yaml` file:
* `section`
* `small`
* `span`
* `strike` (legacy html tag)
* `strong`
* `table`
* `tbody`
Expand All @@ -74,6 +75,7 @@ Add the following to your `pubspec.yaml` file:
* `thead`
* `time`
* `tr`
* `tt` (legacy html tag)
* `u`
* `var`

Expand Down Expand Up @@ -114,6 +116,7 @@ Add the following to your `pubspec.yaml` file:
* `big` (deprecated)
* `button`
* `canvas`
* `center` (deprecated)
* `col`
* `colgroup`
* `datalist`
Expand Down Expand Up @@ -144,11 +147,9 @@ Add the following to your `pubspec.yaml` file:
* `progress`
* `script`
* `select` (`form` elements are outside the scope of this package)
* `strike` (deprecated)
* `style`
* `textarea` (`form` elements are outside the scope of this package)
* `title` (`head` elements are not rendered)
* `tt` (deprecated)


## Why this package?
Expand Down
20 changes: 20 additions & 0 deletions lib/html_parser.dart
Original file line number Diff line number Diff line change
Expand Up @@ -62,6 +62,7 @@ class HtmlParser {
"section",
"small",
"span",
"strike",
"strong",
"table",
"tbody",
Expand All @@ -72,6 +73,7 @@ class HtmlParser {
"thead",
"time",
"tr",
"tt",
"u",
"ul", //partial
"var",
Expand Down Expand Up @@ -537,6 +539,15 @@ class HtmlParser {
return Wrap(
children: _parseNodeList(node.nodes),
);
case "strike":
return DefaultTextStyle.merge(
child: Wrap(
children: _parseNodeList(node.nodes),
),
style: const TextStyle(
decoration: TextDecoration.lineThrough,
),
);
case "strong":
return DefaultTextStyle.merge(
child: Wrap(
Expand Down Expand Up @@ -606,6 +617,15 @@ class HtmlParser {
children: _parseNodeList(node.nodes),
crossAxisAlignment: CrossAxisAlignment.center,
);
case "tt":
return DefaultTextStyle.merge(
child: Wrap(
children: _parseNodeList(node.nodes),
),
style: const TextStyle(
fontFamily: 'monospace',
),
);
case "u":
return DefaultTextStyle.merge(
child: Wrap(
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: flutter_html
description: A Flutter widget for rendering static html tags as Flutter widgets. (Will render over 60 different html tags!)
version: 0.5.2
version: 0.5.3
author: Matthew Whitaker <[email protected]>
homepage: https://github.com/Sub6Resources/flutter_html

Expand Down

0 comments on commit 88c3568

Please sign in to comment.