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] SelectableHtml not displaying <ul> or <li> #1162

Closed eMxPi closed 2 years ago

eMxPi commented 2 years ago

Describe the bug: When Using SelectableHTML on Flutter 3.0.5, html text with <ul> or </li> are skipped.

Capture d’écran 2022-10-10 à 14 20 05

Steps to Reproduce Create a widget based on SelectableHtml and ask it to display html data containing <ul> and </li>

Actual results: Text being displayed when using Html widget Capture d’écran 2022-10-10 à 14 12 35 But not displayed with SelectableHtml Capture d’écran 2022-10-10 à 14 20 05

Code Sample : Semantics( label: 'My test', container: true, excludeSemantics: true, child: SelectableHtml( key: Key('myKey'), data: '<div>this is a sample text: <ul><li>first entry</li><li>first entry</li></ul></div>', ), ),

HTML to reproduce the issue:

this is a sample text:
  • first entry
  • first entry

Html widget configuration: Semantics( label: 'My test', container: true, excludeSemantics: true, child: SelectableHtml( key: Key('myKey'), data: '<div>this is a sample text: <ul><li>first entry</li><li>first entry</li></ul></div>', ), ),

Expected behavior: Capture d’écran 2022-10-10 à 14 12 35

Screenshots:

Device details and Flutter/Dart/flutter_html versions: flutter 3.0.5 and flutter_html 3.0.0-alpha3

sawirricardo commented 2 years ago

Any workaround for this? @Sub6Resources

sawirricardo commented 2 years ago

It also doesnt show any img tag or figure tag, related?

eMxPi commented 2 years ago

My fix => Use SelectedArea with Flutter 3.3 and keep HTML()

sawirricardo commented 2 years ago

My fix => Use SelectedArea with Flutter 3.3 and keep HTML()

SelectionArea you mean?

Sub6Resources commented 2 years ago

@sawirricardo, @eMxPi has the correct and preferred solution. SelectableHtml will be deprecated in the near future in favor of the SelectionArea widget from Flutter 3.3.

See #1153 for more information