Skip to content

Commit ff3fdba

Browse files
committed
Fix hr not showing and improve hr spacing
1 parent e7e69a2 commit ff3fdba

File tree

2 files changed

+4
-2
lines changed

2 files changed

+4
-2
lines changed

lib/html_parser.dart

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -342,7 +342,8 @@ class HtmlParser extends StatelessWidget {
342342
}
343343

344344
//Return the correct InlineSpan based on the element type.
345-
if (tree.style.display == Display.BLOCK && tree.children.isNotEmpty) {
345+
if (tree.style.display == Display.BLOCK &&
346+
(tree.children.isNotEmpty || tree.element?.localName == "hr")) {
346347
if (newContext.parser.selectable) {
347348
return TextSpan(
348349
style: newContext.style.generateTextStyle(),

lib/src/styled_element.dart

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -248,7 +248,8 @@ StyledElement parseStyledElement(
248248
styledElement.style = Style(
249249
margin: EdgeInsets.symmetric(vertical: 7.0),
250250
width: double.infinity,
251-
border: Border(bottom: BorderSide(width: 1.0)),
251+
height: 1,
252+
backgroundColor: Colors.black,
252253
display: Display.BLOCK,
253254
);
254255
break;

0 commit comments

Comments
 (0)