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

List formatting is inaccurate #3973

Open
Packbat opened this issue Aug 20, 2023 · 7 comments
Open

List formatting is inaccurate #3973

Packbat opened this issue Aug 20, 2023 · 7 comments
Assignees

Comments

@Packbat
Copy link

Packbat commented Aug 20, 2023

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.

@nikclayton
Copy link
Contributor

Please can you link to the post.

@nikclayton nikclayton self-assigned this Aug 20, 2023
@nikclayton
Copy link
Contributor

@nikclayton
Copy link
Contributor

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
Copy link
Contributor

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.

@Packbat
Copy link
Author

Packbat commented Aug 20, 2023

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.

@nikclayton
Copy link
Contributor

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.

@connyduck
Copy link
Collaborator

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

#4163 #3973 #4983 #4964

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

No branches or pull requests

3 participants