Start a new topic

Parse Mastodon and Mastodon-like @'s as profile links

Mastodon profile links follow the format "@[username]@[host.url]", e.g. @Mastodon@mastodon.social Currently, the leading @ is ignored and the remainder is parsed as an email address, which creates a mailto: link. I suggest these instead be parsed as a mastodon profile, and generate a link to the corresponding profile, e.g. https://mastodon.social/@mastodon Furthermore, I suggest this format be extended to other common social media sites as well, e.g: * @profile@twitter.com -> https://twitter.com/profile * @profile@cohost.org -> https://cohost.org/profile Custom url translations would be needed for each supported service, but it shouldn't (*knocks on wood*) be too hard to implement a table of url formats.

2 people like this idea

It's worth noting that finding out the proper URI for a Fediverse account is not a simple regex job. The network is not comprised only of Mastodon instances, and not every instance runs on a TLD, making matching an account to a URI unpredictable. For example, I run an Akkoma server on a subdomain, with an address that doesn't include the subdomain—only reliable way to know is to query .well-known webfinger resources to figure out the proper canonical URL.


1 person likes this

Aria's comment is correct and makes me think that, in the absence of a full solution, cohost simply just did not do the current parsing that results in a mailto: link.

Login or Signup to post a comment