Tusky icon indicating copy to clipboard operation
Tusky copied to clipboard

List formatting is inaccurate

Open Packbat opened this issue 2 years ago • 7 comments

On a Glitch fork instance, we made a post with a numbered list. Tusky displayed this as a bullet point list.

Firefox screenshot. The post has a list with two items, labeled 1 and 2. Tusky screenshot. The post has the same list with the same two items, but small dots - bullet points - mark off each item and no numners are present.


  • Tusky Version: 23.0

  • Android Version: 13

  • Android Device: Galaxy A14 5G

  • Mastodon instance (if applicable): indiepocalypse.social

  • [ + ] I searched or browsed the repo’s other issues to ensure this is not a duplicate.

Packbat avatar Aug 20 '23 01:08 Packbat

Please can you link to the post.

nikclayton avatar Aug 20 '23 07:08 nikclayton

Note to self: It's https://mastodon.social/@[email protected]/110919195359525973

nikclayton avatar Aug 20 '23 09:08 nikclayton

Fetching the post with the API, the embedded HTML is an ordered list, so should be numbered instead of bullets:

"content": "<p>I wonder what the best way is to</p><ol><li>create a standard midi .mid file in 2023</li><li>embed a standard midi .mid file in a website in 2023 so that it will play for most people browsing</li></ol>",

nikclayton avatar Aug 20 '23 09:08 nikclayton

This is an Android bug. If you trace the code from com.keylesspalace.tusky.util.StatusParsingHelper#parseAsMastodonHtml(java.lang.String, android.text.Html.TagHandler) down to android.text.HtmlToSpannedConverter#handleStartTag you'll discover that although it handles ul/li it does not handle ol/li -- that'll need to be done with a custom tag handler.

nikclayton avatar Aug 20 '23 10:08 nikclayton

Oh! sorry for not linking the post - I didn't see your reply right away.

Also ugh, that sounds like a pain. That's some very basic HTML functionality to mishandle. Thanks for tracking that down.

Packbat avatar Aug 20 '23 14:08 Packbat

https://github.com/NightWhistler/HtmlSpanner exists to fix issues like this. In theory it's a drop-in replacement, in practice we'll want to do some careful before/after checks to make sure it's not introducing any regressions.

nikclayton avatar Aug 20 '23 20:08 nikclayton

These are all related and should be addressed together. We will probably need a better html parser to fix them.

https://github.com/tuskyapp/Tusky/issues/4163 https://github.com/tuskyapp/Tusky/issues/3973 https://github.com/tuskyapp/Tusky/issues/4983 https://github.com/tuskyapp/Tusky/issues/4964

connyduck avatar Mar 10 '25 20:03 connyduck