Skip to content

Commit 8e0b497

Browse files
committed
Version 0.5.1
1 parent cea2c4a commit 8e0b497

File tree

5 files changed

+97
-60
lines changed

5 files changed

+97
-60
lines changed

CHANGELOG.md

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,15 @@
1+
## [0.5.1] - August 25, 2018:
2+
3+
* Fixed issue with table rows not lining up correctly ([#4](https://github.com/Sub6Resources/flutter_html/issues/4))
4+
15
## [0.5.0] - August 23, 2018:
26

37
* Major refactor that makes entire tree a Widget and eliminates the need to distinguish between inline and block elements.
4-
* Fixed #7, #9, #10, and #11.
8+
* Fixed [#7](https://github.com/Sub6Resources/flutter_html/issues/7), [#9](https://github.com/Sub6Resources/flutter_html/issues/9), [#10](https://github.com/Sub6Resources/flutter_html/issues/10), and [#11](https://github.com/Sub6Resources/flutter_html/issues/11).
59

610
## [0.4.1] - August 15, 2018:
711

8-
* Fixed issue with images not loading when inside of `p` tag (#6)
12+
* Fixed issue with images not loading when inside of `p` tag ([#6](https://github.com/Sub6Resources/flutter_html/issues/6))
913

1014
## [0.4.0] - August 15, 2018:
1115

README.md

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

1010
dependencies:
11-
flutter_html: ^0.5.0
11+
flutter_html: ^0.5.1
1212

1313
## Currently Supported HTML Tags:
1414

lib/html_parser.dart

Lines changed: 25 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -167,8 +167,12 @@ class HtmlParser {
167167
}
168168
return Container(width: width);
169169
case "caption":
170-
return Wrap(
171-
children: _parseNodeList(node.nodes),
170+
return Container(
171+
width: width,
172+
child: Wrap(
173+
alignment: WrapAlignment.center,
174+
children: _parseNodeList(node.nodes),
175+
),
172176
);
173177
case "cite":
174178
return DefaultTextStyle.merge(
@@ -532,8 +536,15 @@ class HtmlParser {
532536
crossAxisAlignment: CrossAxisAlignment.start,
533537
);
534538
case "td":
535-
return Row(
536-
children: _parseNodeList(node.nodes),
539+
int colspan = 1;
540+
if (node.attributes['colspan'] != null) {
541+
colspan = int.tryParse(node.attributes['colspan']);
542+
}
543+
return Expanded(
544+
flex: colspan,
545+
child: Wrap(
546+
children: _parseNodeList(node.nodes),
547+
),
537548
);
538549
case "template":
539550
//Not usually displayed in HTML
@@ -544,9 +555,17 @@ class HtmlParser {
544555
crossAxisAlignment: CrossAxisAlignment.start,
545556
);
546557
case "th":
558+
int colspan = 1;
559+
if (node.attributes['colspan'] != null) {
560+
colspan = int.tryParse(node.attributes['colspan']);
561+
}
547562
return DefaultTextStyle.merge(
548-
child: Wrap(
549-
children: _parseNodeList(node.nodes),
563+
child: Expanded(
564+
flex: colspan,
565+
child: Wrap(
566+
alignment: WrapAlignment.center,
567+
children: _parseNodeList(node.nodes),
568+
),
550569
),
551570
style: const TextStyle(
552571
fontWeight: FontWeight.bold,

0 commit comments

Comments
 (0)