Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[BUG] "0" is added in every <li> tag #1389

Open
Vignesh-Dart opened this issue Oct 24, 2023 · 1 comment
Open

[BUG] "0" is added in every <li> tag #1389

Vignesh-Dart opened this issue Oct 24, 2023 · 1 comment
Labels
bug Something isn't working

Comments

@Vignesh-Dart
Copy link

Vignesh-Dart commented Oct 24, 2023

"0" is added in every list tag:

HTML to reproduce the issue:

var data1 = ''' <li>One</li>\r\n<li>Two</li>\r\n<li>Three</li> ''';

Html widget configuration:

Html( data: data1, style: { "html": Style( fontSize: FontSize(15.1), fontWeight: FontWeight.w500, ), }, ),

Expected behavior:

Remove "0" in every <li> tag

Screenshots:

image

Versions:

flutter_html: ^3.0.0-beta.2

@Vignesh-Dart Vignesh-Dart added the bug Something isn't working label Oct 24, 2023
@timothyrobb
Copy link

@Vignesh-Dart If you pass invalid HTML to an HTML renderer, of course it'll have unexpected results.
The code assumes an Ordered List (<ol>) for all List Item tags (<li>), but without a parent wrapping tag, it can't tell how many are in the list.
'''<ol><li>One</li>\r\n<li>Two</li>\r\n<li>Three</li></ol>'''
Should give you

1. One
2. Two
3. Three

Or
'''<ul><li>One</li>\r\n<li>Two</li>\r\n<li>Three</li></ul>'''
Should give you:

• One
• Two
• Three

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
Status: Todo
Development

No branches or pull requests

2 participants