Skip to content

Commit

Permalink
Version 0.5.2
Browse files Browse the repository at this point in the history
  • Loading branch information
Sub6Resources committed Aug 26, 2018
1 parent 8e0b497 commit f5081f2
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.2] - August 25, 2018:

* Adds support for `bdi` and `bdo`

## [0.5.1] - August 25, 2018:

* Fixed issue with table rows not lining up correctly ([#4](https://github.com/Sub6Resources/flutter_html/issues/4))
Expand Down
6 changes: 3 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.1
flutter_html: ^0.5.2

## Currently Supported HTML Tags:

Expand All @@ -17,6 +17,8 @@ Add the following to your `pubspec.yaml` file:
* `article`
* `aside`
* `b`
* `bdi`
* `bdo`
* `blockquote`
* `body`
* `br`
Expand Down Expand Up @@ -86,8 +88,6 @@ Add the following to your `pubspec.yaml` file:
> These are elements that are planned, but present a specific challenge that makes them somewhat difficult to implement.
* `audio`
* `bdi`
* `bdo`
* `details`
* `source`
* `sub`
Expand Down
21 changes: 21 additions & 0 deletions lib/html_parser.dart
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,8 @@ class HtmlParser {
"article",
"aside",
"b",
"bdi",
"bdo",
"blockquote",
"body",
"br",
Expand Down Expand Up @@ -143,6 +145,25 @@ class HtmlParser {
fontWeight: FontWeight.bold,
),
);
case "bdi":
return Wrap(
children: _parseNodeList(node.nodes),
);
case "bdo":
if (node.attributes["dir"] != null) {
return Directionality(
child: Wrap(
children: _parseNodeList(node.nodes),
),
textDirection: node.attributes["dir"] == "rtl"
? TextDirection.rtl
: TextDirection.ltr,
);
}
//Direction attribute is required, just render the text normally now.
return Wrap(
children: _parseNodeList(node.nodes),
);
case "blockquote":
return Padding(
padding: EdgeInsets.fromLTRB(40.0, 14.0, 40.0, 14.0),
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.1
version: 0.5.2
author: Matthew Whitaker <[email protected]>
homepage: https://github.com/Sub6Resources/flutter_html

Expand Down

0 comments on commit f5081f2

Please sign in to comment.