[mastodon-client] Fix mentions in user bios

This commit is contained in:
Laura Hausmann 2023-10-12 00:23:20 +02:00
parent 1ff5102e34
commit 44c70df1a6
No known key found for this signature in database
GPG key ID: D044E84C5BE01605

View file

@ -139,12 +139,15 @@ export class MfmHelpers {
remoteUser.username === username && remoteUser.host === host, remoteUser.username === username && remoteUser.host === host,
); );
const localpart = `@${username}`; const localpart = `@${username}`;
const acct = host === config.domain ? localpart: node.props.acct; const isLocal = host === config.domain || host === null;
const acct = isLocal ? 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}`; : isLocal
? `${config.url}/${acct}`
: `https://${host}/${localpart}`;
a.className = "u-url mention"; a.className = "u-url mention";
const span = doc.createElement("span"); const span = doc.createElement("span");
span.textContent = username; span.textContent = username;