mentionsCompat: wrap each mention in an h-card span

This commit is contained in:
Alex Gleason 2024-08-07 17:54:45 -05:00
parent ab17be219c
commit 2e38a7b9ec
No known key found for this signature in database
GPG key ID: 7211D1F99744FBB7

View file

@ -172,7 +172,7 @@ function buildInlineRecipients(mentions: MastodonMention[]): string {
const elements = mentions.reduce<string[]>((acc, { url, username }) => { const elements = mentions.reduce<string[]>((acc, { url, username }) => {
const name = nip19.BECH32_REGEX.test(username) ? username.substring(0, 8) : username; const name = nip19.BECH32_REGEX.test(username) ? username.substring(0, 8) : username;
acc.push(`<a href="${url}" class="u-url mention" rel="ugc">@<span>${name}</span></a>`); acc.push(`<span class="h-card"><a class="u-url mention" href="${url}" rel="ugc">@<span>${name}</span></a></span>`);
return acc; return acc;
}, []); }, []);