Sub6Resources / flutter_html

A Flutter widget for rendering static html as Flutter widgets (Will render over 80 different html tags!)
https://pub.dev/packages/flutter_html
MIT License
1.8k stars 874 forks source link

[BUG] <hr> doesn't follow font color #1159

Closed TheCarpetMerchant closed 2 years ago

TheCarpetMerchant commented 2 years ago

Describe the bug: the <hr> tag doesn't follow the font color, as could be reasonably expected, but more importantly does not seem to be modifiable at all.

HTML to reproduce the issue: <hr>

Html widget configuration: N/A, but you can simply try with {'hr': Style(color: Colors.red) for example. But I do think following the font color of its parent should be the way to go, notably to keep a good compatibility with previous versions.

Sub6Resources commented 2 years ago

This is expected behavior. <hr> is styled using the border property. See https://www.w3schools.com/howto/howto_css_style_hr.asp for more details. Other than only producing solid-style borders (no dashed or dotted), flutter_html fully supports the code example on that page.

TheCarpetMerchant commented 2 years ago

Ah cool, thanks for the info. It's not intuitive but does make sense. If you can find a place where to document that information, it would be useful to prevent other people like me from opening useless issues.

Sub6Resources commented 2 years ago

For sure. Our documentation could certainly be improved!

Sub6Resources commented 2 years ago

Added some documentation for hr to the wiki: https://github.com/Sub6Resources/flutter_html/wiki/Supported-HTML-Elements#hr