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

Unsorted bullet point list <ul> adds missing symbol after each circle [iOS](v1.0.2) #390

Closed
joelbrostrom opened this issue Aug 26, 2020 · 8 comments · Fixed by #537
Closed

Comments

@joelbrostrom
Copy link

joelbrostrom commented Aug 26, 2020

After each bullet point in a bullet list a "crossed box" symbol is rendered before the list item.
This only effect iOS.

The structure looks like this:

<p>
<ul>
    <li>Text1</li>
    <li>Text2</li>
    <li>
        <ul>
            <li>Text3</li>
            <li>Text4</li>
            <li>Text5</li>
        </ul>
    </li>
</ul>
</p>

and it renders like this:

Screenshot 2020-08-26 at 14 27 34

@joelbrostrom
Copy link
Author

Even using the example from the Example section

<h3>List support:</h3>
      <ol>
            <li>This</li>
            <li><p>is</p></li>
            <li>an</li>
            <li>
            ordered
            <ul>
            <li>With<br /><br />...</li>
            <li>a</li>
            <li>nested</li>
            <li>unordered
            <ol>
            <li>With a nested</li>
            <li>ordered list.</li>
            </ol>
            </li>
            <li>list</li>
            </ul>
            </li>
            <li>list! Lorem ipsum dolor sit amet.</li>
            <li><h2>Header 2</h2></li>
            <h2><li>Header 2</li></h2>
      </ol>

results in this on iOS:

Screenshot 2020-08-26 at 15 19 17

@joelbrostrom joelbrostrom changed the title Unsorted bullet point list <ul> adds missing symbol after each circle [iOS] Unsorted bullet point list <ul> adds missing symbol after each circle [iOS](v1.0.2) Aug 27, 2020
@joelbrostrom
Copy link
Author

This is a breaking change in one of the most fundamental tags and should be given high priority.
All iOS devices can't currently use the plugin, and since it enforced migration in 1.0.0 you cant just revert to < 1.0.0.
Can someone please give this some attention.

@joelbrostrom
Copy link
Author

I found the root of the problem.

For some reason \t does not render as tab on iOS but instead shows the reported icon above.
This is not a problem of \t itself. Just typing it in a string outside of the package will render a tab (white space) so something is happening in between.

I temporarily fixed it by removing the tab and add padding to the text widget instead.

html_parser.dart - line 271
Current

PositionedDirectional(                              
  width: 30, //TODO derive this from list padding.  
  start: 0,                                         
  child: Text('${newContext.style.markerContent}\t',
      textAlign: TextAlign.right,                   
      style: newContext.style.generateTextStyle()), 
),                                                  

Fix

PositionedDirectional(                               
  width: 30, //TODO derive this from list padding.   
  start: 0,                                          
  child: Padding(padding: EdgeInsets.only(right: 16),
    child: Text('${newContext.style.markerContent}', 
        textAlign: TextAlign.right,                  
        style: newContext.style.generateTextStyle()),
  ),                                                 
),                                                   

I don't know how much a tab is supposed to indent the text, or if this is the desired way of solving it.
If it is i can make a MR

@aravindhkumar23
Copy link

Hi @joelbrostrom Thanks for the workaround,
Will it take time to get the new release with this changes, Because I got the issue reported from my client and app needs version update asap.

@joelbrostrom
Copy link
Author

Hi!
It's more a question of the right way of solving it.
Right now I just add some arbitrary padding that looks good for my use case, but I assume a \t tab is rendered differently in different situations and on different devices.

In the meantime you can either modify the code yourself or use my fork until it's solved on the main branch by replacing the pubspec.yaml dependency to this:

  # flutter_html: ^1.0.2 #This should replace the forked repo on @joelbrostrom 's repo once the bullet point bug is fixed
  flutter_html: #This is a fork of 1.0.2 that fixes the error icons popping up after each bullet point.
    git:
      url: https://github.com/joelbrostrom/flutter_html.git

@aravindhkumar23
Copy link

@joelbrostrom thanks for the swift reply.
I will try to use the git repo which you provided.

@viniciusaro
Copy link

Same problem reported here: #327 just for reference

@tneotia
Copy link
Collaborator

tneotia commented Feb 10, 2021

Took care of this in the above PR, it was related to the font size. Basically it now has a separate text widget just for the tab character without any text styling so the unknown character box doesn't show up.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
4 participants