Link preview cards for text fragment URIs should include the text fragment
Pitch
When someone posts a text fragment link, the preview card that Mastodon generates should include the text fragment displayed as a quote, consistent with how other communication apps display them.
These should be shown in the web interface, and returned by the API (probably as an attribute on PreviewCard) so that clients can make use of them without having to parse the links client-side. Additionally, having Mastodon process these server-side should include verifying that the text actually occurs on the linked page, preventing users from posting fake quotes.
Motivation
Text fragment URIs are a useful feature of the web for linking to a specific quote within an article. They’re widely supported. Safari at least has a “copy link with highlight” command in its context menus, making these links easy to create.
Other apps display these as quotes. For example if I paste https://arstechnica.com/gaming/2026/09/steam-frame-the-ars-technica-review/#:~:text=simultaneously%20overengineered%20and%20underbaked%2C%20depending%20on%20how%20you%20look%20at%20it (a quote copied from an Ars Technica article using Safari’s “Copy link with highlight”) into Apple Messages, the link preview looks like this:
If I post the same link in Mastodon today, it just shows a generic link preview card for the article, lacking the quote that is being linked to. Mastodon should be a good web citizen and support standard web features like this.
Source: mastodon/mastodon