daphliu-zz / android-spannable-list-sample

MIT License
21 stars 3 forks source link

Numbered List Bug #1

Open TheDancerCodes opened 4 years ago

TheDancerCodes commented 4 years ago

Hi @daphliu Thanks for sharing your implementation. I have found it very helpful on a project I am working on.

I discovered a bug though. When you create an unordered list and immediately create a numbered list underneath it, it breaks the numbered list rendering.

This is an example of the HTML:

            <ul>
                <li>unordered list 1</li>
                <li>unordered <strong>list</strong> 2 with bold</li>
                <li>unordered <em>list</em> 3 with italic</li>
            </ul>

            <ol>
                <li>ordered list 1</li>
                <li>ordered <strong>list</strong> 2 with bold</li>
                <li>ordered <em>list</em> 3 with italic</li>
            </ol>

This is the screenshot of the broken numbered list: broken-numbered-list

Any thoughts on how to resolve this?

gilbertdigio commented 3 years ago

Thanks for sharing @daphliu , I have the same issue with two unordered lists at the same level. The indentation of dot marks of the second list looks like the example above.

Do you think it's posible to avoid this issue? Thanks in advance.

sunnyjain commented 6 months ago

Hi @TheDancerCodes @gilbertdigio ,

This is a weird behaviour from Html.TagHandler. I encountered a similar issue and while debugging, and upon conducting further research, I found a relevant discussion on Stack Overflow SO link. The solution proposed in the thread effectively resolves the issue by incorporating a 'zero width joiner' &zwj at the start of the html string.