Hi, Hypolite from Friendica here.
I’ve been asked today why the Mastodon mentions displayed in Friendica-originated posts link to the remote server profile instead of opening the local user profile.
Here’s the HTML code for a mention in Mastodon from Mastodon:
<span class="h-card"> <a href="https://friendica.mrpetovan.com/profile/hypolite" class="u-url mention"> @<span>hypolite</span> </a> </span>
And here’s the HTML code for a mention in Mastodon from Friendica:
@<span class=""> <a href="https://mastodon.xyz/users/lightone" class="u-url mention" rel="nofollow noopener noreferrer" target="_blank"> <span class="mention">lightone</span> </a> </span>
As you can see, the
h-card class is missing from the latter, and the link is treated like an external link with the
rel="nofollow noopener noreferrer" target="_blank" attributes.
@ sign is located outside of the link but I’m not sure if it’s important.
I couldn’t find any spot in Friendica where we would be generating this code so I assume that there’s a convention in Mastodon messages to format mentions a certain way which gets displayed this way, while Friendica almost-but-not-quite-the-same format doesn’t pass muster.
So what’s the correct mention format for them to behave the same whether they come from Friendica or from Mastodon?
Thank you in advance for our consideration.