From ff3fdba8874d539353f9849dc5540eb4ae375e04 Mon Sep 17 00:00:00 2001 From: tanay Date: Mon, 28 Jun 2021 17:38:42 -0400 Subject: [PATCH] Fix hr not showing and improve hr spacing --- lib/html_parser.dart | 3 ++- lib/src/styled_element.dart | 3 ++- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/lib/html_parser.dart b/lib/html_parser.dart index 761e5fd2cc..b61e9c4e53 100644 --- a/lib/html_parser.dart +++ b/lib/html_parser.dart @@ -342,7 +342,8 @@ class HtmlParser extends StatelessWidget { } //Return the correct InlineSpan based on the element type. - if (tree.style.display == Display.BLOCK && tree.children.isNotEmpty) { + if (tree.style.display == Display.BLOCK && + (tree.children.isNotEmpty || tree.element?.localName == "hr")) { if (newContext.parser.selectable) { return TextSpan( style: newContext.style.generateTextStyle(), diff --git a/lib/src/styled_element.dart b/lib/src/styled_element.dart index 164f243434..f3331fc045 100644 --- a/lib/src/styled_element.dart +++ b/lib/src/styled_element.dart @@ -248,7 +248,8 @@ StyledElement parseStyledElement( styledElement.style = Style( margin: EdgeInsets.symmetric(vertical: 7.0), width: double.infinity, - border: Border(bottom: BorderSide(width: 1.0)), + height: 1, + backgroundColor: Colors.black, display: Display.BLOCK, ); break;