[mastodon-client] Only display localpart for mentions in mfm-to-html

This commit is contained in:
Laura Hausmann 2023-10-11 19:15:56 +02:00
parent f5c6cba3a6
commit 1fdea9866a
Signed by: zotan
GPG key ID: D044E84C5BE01605

View file

@ -127,14 +127,15 @@ export class MfmHelpers {
(remoteUser) => (remoteUser) =>
remoteUser.username === username && remoteUser.host === host, remoteUser.username === username && remoteUser.host === host,
); );
const acct = host === config.domain ? `@${username}` : node.props.acct; const localpart = `@${username}`;
const acct = host === config.domain ? localpart: node.props.acct;
a.href = remoteUserInfo a.href = remoteUserInfo
? remoteUserInfo.url ? remoteUserInfo.url
? remoteUserInfo.url ? remoteUserInfo.url
: remoteUserInfo.uri : remoteUserInfo.uri
: `${config.url}/${acct}`; : `${config.url}/${acct}`;
a.className = "u-url mention"; a.className = "u-url mention";
a.textContent = acct; a.textContent = localpart;
return a; return a;
}, },