From 8e0b497bf1d117186a1bc5148f53401604ff49b2 Mon Sep 17 00:00:00 2001 From: MatthewWhitaker Date: Sat, 25 Aug 2018 16:02:28 -0600 Subject: [PATCH] Version 0.5.1 --- CHANGELOG.md | 8 ++- README.md | 2 +- lib/html_parser.dart | 31 +++++++++--- pubspec.lock | 114 ++++++++++++++++++++++++------------------- pubspec.yaml | 2 +- 5 files changed, 97 insertions(+), 60 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 89409dfda4..5d2e0a60cc 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,11 +1,15 @@ +## [0.5.1] - August 25, 2018: + +* Fixed issue with table rows not lining up correctly ([#4](https://github.com/Sub6Resources/flutter_html/issues/4)) + ## [0.5.0] - August 23, 2018: * Major refactor that makes entire tree a Widget and eliminates the need to distinguish between inline and block elements. -* Fixed #7, #9, #10, and #11. +* 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). ## [0.4.1] - August 15, 2018: -* Fixed issue with images not loading when inside of `p` tag (#6) +* Fixed issue with images not loading when inside of `p` tag ([#6](https://github.com/Sub6Resources/flutter_html/issues/6)) ## [0.4.0] - August 15, 2018: diff --git a/README.md b/README.md index a0574ea4af..2b31f3e26f 100644 --- a/README.md +++ b/README.md @@ -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.0 + flutter_html: ^0.5.1 ## Currently Supported HTML Tags: diff --git a/lib/html_parser.dart b/lib/html_parser.dart index d87b89957e..7f41544b6a 100644 --- a/lib/html_parser.dart +++ b/lib/html_parser.dart @@ -167,8 +167,12 @@ class HtmlParser { } return Container(width: width); case "caption": - return Wrap( - children: _parseNodeList(node.nodes), + return Container( + width: width, + child: Wrap( + alignment: WrapAlignment.center, + children: _parseNodeList(node.nodes), + ), ); case "cite": return DefaultTextStyle.merge( @@ -532,8 +536,15 @@ class HtmlParser { crossAxisAlignment: CrossAxisAlignment.start, ); case "td": - return Row( - children: _parseNodeList(node.nodes), + int colspan = 1; + if (node.attributes['colspan'] != null) { + colspan = int.tryParse(node.attributes['colspan']); + } + return Expanded( + flex: colspan, + child: Wrap( + children: _parseNodeList(node.nodes), + ), ); case "template": //Not usually displayed in HTML @@ -544,9 +555,17 @@ class HtmlParser { crossAxisAlignment: CrossAxisAlignment.start, ); case "th": + int colspan = 1; + if (node.attributes['colspan'] != null) { + colspan = int.tryParse(node.attributes['colspan']); + } return DefaultTextStyle.merge( - child: Wrap( - children: _parseNodeList(node.nodes), + child: Expanded( + flex: colspan, + child: Wrap( + alignment: WrapAlignment.center, + children: _parseNodeList(node.nodes), + ), ), style: const TextStyle( fontWeight: FontWeight.bold, diff --git a/pubspec.lock b/pubspec.lock index c55ae3391b..7b1bb67945 100644 --- a/pubspec.lock +++ b/pubspec.lock @@ -7,63 +7,63 @@ packages: name: analyzer url: "https://pub.dartlang.org" source: hosted - version: "0.31.2-alpha.2" + version: "0.32.4" args: dependency: transitive description: name: args url: "https://pub.dartlang.org" source: hosted - version: "1.4.3" + version: "1.5.0" async: dependency: transitive description: name: async url: "https://pub.dartlang.org" source: hosted - version: "2.0.7" + version: "2.0.8" boolean_selector: dependency: transitive description: name: boolean_selector url: "https://pub.dartlang.org" source: hosted - version: "1.0.3" + version: "1.0.4" charcode: dependency: transitive description: name: charcode url: "https://pub.dartlang.org" source: hosted - version: "1.1.1" + version: "1.1.2" collection: dependency: transitive description: name: collection url: "https://pub.dartlang.org" source: hosted - version: "1.14.6" + version: "1.14.11" convert: dependency: transitive description: name: convert url: "https://pub.dartlang.org" source: hosted - version: "2.0.1" + version: "2.0.2" crypto: dependency: transitive description: name: crypto url: "https://pub.dartlang.org" source: hosted - version: "2.0.3" + version: "2.0.6" csslib: dependency: transitive description: name: csslib url: "https://pub.dartlang.org" source: hosted - version: "0.14.4" + version: "0.14.5" flutter: dependency: "direct main" description: flutter @@ -80,182 +80,189 @@ packages: name: front_end url: "https://pub.dartlang.org" source: hosted - version: "0.1.0-alpha.12" + version: "0.1.4" glob: dependency: transitive description: name: glob url: "https://pub.dartlang.org" source: hosted - version: "1.1.5" + version: "1.1.7" html: dependency: "direct main" description: name: html url: "https://pub.dartlang.org" source: hosted - version: "0.13.3" + version: "0.13.3+3" http: dependency: transitive description: name: http url: "https://pub.dartlang.org" source: hosted - version: "0.11.3+16" + version: "0.11.3+17" http_multi_server: dependency: transitive description: name: http_multi_server url: "https://pub.dartlang.org" source: hosted - version: "2.0.4" + version: "2.0.5" http_parser: dependency: transitive description: name: http_parser url: "https://pub.dartlang.org" source: hosted - version: "3.1.2" + version: "3.1.3" io: dependency: transitive description: name: io url: "https://pub.dartlang.org" source: hosted - version: "0.3.2+1" + version: "0.3.3" js: dependency: transitive description: name: js url: "https://pub.dartlang.org" source: hosted - version: "0.6.1" + version: "0.6.1+1" + json_rpc_2: + dependency: transitive + description: + name: json_rpc_2 + url: "https://pub.dartlang.org" + source: hosted + version: "2.0.9" kernel: dependency: transitive description: name: kernel url: "https://pub.dartlang.org" source: hosted - version: "0.3.0-alpha.12" + version: "0.3.4" logging: dependency: transitive description: name: logging url: "https://pub.dartlang.org" source: hosted - version: "0.11.3+1" + version: "0.11.3+2" matcher: dependency: transitive description: name: matcher url: "https://pub.dartlang.org" source: hosted - version: "0.12.2+1" + version: "0.12.3+1" meta: dependency: transitive description: name: meta url: "https://pub.dartlang.org" source: hosted - version: "1.1.5" + version: "1.1.6" mime: dependency: transitive description: name: mime url: "https://pub.dartlang.org" source: hosted - version: "0.9.6" + version: "0.9.6+2" multi_server_socket: dependency: transitive description: name: multi_server_socket url: "https://pub.dartlang.org" source: hosted - version: "1.0.1" + version: "1.0.2" node_preamble: dependency: transitive description: name: node_preamble url: "https://pub.dartlang.org" source: hosted - version: "1.4.1" + version: "1.4.4" package_config: dependency: transitive description: name: package_config url: "https://pub.dartlang.org" source: hosted - version: "1.0.3" + version: "1.0.5" package_resolver: dependency: transitive description: name: package_resolver url: "https://pub.dartlang.org" source: hosted - version: "1.0.2" + version: "1.0.4" path: dependency: transitive description: name: path url: "https://pub.dartlang.org" source: hosted - version: "1.5.1" + version: "1.6.2" plugin: dependency: transitive description: name: plugin url: "https://pub.dartlang.org" source: hosted - version: "0.2.0+2" + version: "0.2.0+3" pool: dependency: transitive description: name: pool url: "https://pub.dartlang.org" source: hosted - version: "1.3.4" + version: "1.3.6" pub_semver: dependency: transitive description: name: pub_semver url: "https://pub.dartlang.org" source: hosted - version: "1.4.1" + version: "1.4.2" quiver: dependency: transitive description: name: quiver url: "https://pub.dartlang.org" source: hosted - version: "0.29.0+1" + version: "2.0.0+1" shelf: dependency: transitive description: name: shelf url: "https://pub.dartlang.org" source: hosted - version: "0.7.3" + version: "0.7.3+3" shelf_packages_handler: dependency: transitive description: name: shelf_packages_handler url: "https://pub.dartlang.org" source: hosted - version: "1.0.3" + version: "1.0.4" shelf_static: dependency: transitive description: name: shelf_static url: "https://pub.dartlang.org" source: hosted - version: "0.2.7" + version: "0.2.8" shelf_web_socket: dependency: transitive description: name: shelf_web_socket url: "https://pub.dartlang.org" source: hosted - version: "0.2.2" + version: "0.2.2+4" sky_engine: dependency: transitive description: flutter @@ -267,98 +274,105 @@ packages: name: source_map_stack_trace url: "https://pub.dartlang.org" source: hosted - version: "1.1.4" + version: "1.1.5" source_maps: dependency: transitive description: name: source_maps url: "https://pub.dartlang.org" source: hosted - version: "0.10.5" + version: "0.10.7" source_span: dependency: transitive description: name: source_span url: "https://pub.dartlang.org" source: hosted - version: "1.4.0" + version: "1.4.1" stack_trace: dependency: transitive description: name: stack_trace url: "https://pub.dartlang.org" source: hosted - version: "1.9.2" + version: "1.9.3" stream_channel: dependency: transitive description: name: stream_channel url: "https://pub.dartlang.org" source: hosted - version: "1.6.6" + version: "1.6.8" string_scanner: dependency: transitive description: name: string_scanner url: "https://pub.dartlang.org" source: hosted - version: "1.0.2" + version: "1.0.4" term_glyph: dependency: transitive description: name: term_glyph url: "https://pub.dartlang.org" source: hosted - version: "1.0.0" + version: "1.0.1" test: dependency: transitive description: name: test url: "https://pub.dartlang.org" source: hosted - version: "0.12.37" + version: "1.3.0" typed_data: dependency: transitive description: name: typed_data url: "https://pub.dartlang.org" source: hosted - version: "1.1.5" + version: "1.1.6" utf: dependency: transitive description: name: utf url: "https://pub.dartlang.org" source: hosted - version: "0.9.0+4" + version: "0.9.0+5" vector_math: dependency: transitive description: name: vector_math url: "https://pub.dartlang.org" source: hosted - version: "2.0.6" + version: "2.0.8" + vm_service_client: + dependency: transitive + description: + name: vm_service_client + url: "https://pub.dartlang.org" + source: hosted + version: "0.2.6" watcher: dependency: transitive description: name: watcher url: "https://pub.dartlang.org" source: hosted - version: "0.9.7+7" + version: "0.9.7+10" web_socket_channel: dependency: transitive description: name: web_socket_channel url: "https://pub.dartlang.org" source: hosted - version: "1.0.7" + version: "1.0.9" yaml: dependency: transitive description: name: yaml url: "https://pub.dartlang.org" source: hosted - version: "2.1.13" + version: "2.1.15" sdks: - dart: ">=2.0.0-dev.52.0 <=2.0.0-dev.58.0.flutter-f981f09760" + dart: ">=2.0.0-dev.68.0 <3.0.0" flutter: ">=0.5.0 <0.8.0" diff --git a/pubspec.yaml b/pubspec.yaml index 1e942f2d1f..faca9da9d8 100644 --- a/pubspec.yaml +++ b/pubspec.yaml @@ -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.0 +version: 0.5.1 author: Matthew Whitaker homepage: https://github.com/Sub6Resources/flutter_html