List formatting is inaccurate
On a Glitch fork instance, we made a post with a numbered list. Tusky displayed this as a bullet point list.
-
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.
Please can you link to the post.
Note to self: It's https://mastodon.social/@[email protected]/110919195359525973
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>",
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.
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.
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.
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