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.79k stars 860 forks source link

[BUG] Nesting divs increases the font size #1179

Closed bananowysong closed 1 year ago

bananowysong commented 1 year ago

Describe the bug: When nesting elements like <div> <p>and so on, it seems that the font sizes increases the more nested the text is as if multiplied.

flutter_html version flutter_html: ^3.0.0-alpha.6

HTML to reproduce the issue:

tseter without p
<p>tester tester in p</p>
<ul>
  <li>Coffee</li>
  <li>Tea</li>
  <li>Milk</li>
</ul>
<div>tester in div</div>
<div>
<ul>
  <li>Coffee</li>
  <li>Tea</li>
  <li>Milk</li>
</ul
</div>
<div>
<div>
<ul>
  <li>Coffee</li>
  <li>Tea</li>
  <li>Milk</li>
</ul
</div>
</div>
<div>
<div>
<div>
<ul>
  <li>Coffee</li>
  <li>Tea</li>
  <li>Milk</li>
</ul
</div>
</div>
</div>

Html widget configuration: Default Html widget, no additional styling.

Expected behavior: The font size should not increase by itself when HTML tags are nested.

Screenshots: image

Device details and Flutter/Dart/flutter_html versions: Samsung a52s 5g. Android 12. One ui 4.1

On android emulator (pixel 2, ios simulators and iphone xs max it looks all fine)

A picture of a cute animal (not mandatory but encouraged) image

erickok commented 1 year ago

Which flutter_html version are you using? This should have been fixed in #1173

bananowysong commented 1 year ago

Hello, I have been using flutter_html: ^3.0.0-alpha.6 from pub, but like you said, using the latest version from the repo fixes the issue.

erickok commented 1 year ago

No worries and thanks for the 🐰

Sub6Resources commented 1 year ago

Closing since this is fixed in the latest repository version. Until the version following 3.0.0-alpha.6 is released, you can use 3.0.0-alpha.5 if you are having scaling issues and don't want to use the GitHub repository version.