-
-
Notifications
You must be signed in to change notification settings - Fork 7.3k
Description
Steps to reproduce the problem
- View the post https://mastodon.social/@gvwilson/112294375846907813 and look at the title of the link preview card.
Expected behaviour
Title should begin with text, not excessive whitespace
Actual behaviour
Title contains excessive whitespace before the text
Detailed description
The site this post links to has an… interesting way of marking up their title tags:
While that is ultimately that site’s fault, Mastodon should probably strip the whitespace when parsing it for link previews. It doesn’t, so the result in the web UI is:
The string returned for the card
by the Mastodon API (https://mastodon.social/api/v1/statuses/112294375846907813) is even worse:
"title": "\r\n\t\t\r\n\t\t\r\n\t\t\t\r\n\t\t\t\r\n\t\t\r\n\t\tLab Dynamics: Management and Leadership Skills for Scientists, Third Edition\r\n\t"
For comparison, it seems web browsers do strip the whitespace when displaying page titles.
Mastodon instance
mastodon.social
Mastodon version
v4.3.0-nightly.2024-04-18
Technical details
No response