Hide non-profile nostr URIs from text

This commit is contained in:
Alex Gleason
2024-08-28 21:24:50 +02:00
parent ba77787767
commit 0b6ca9dfea
2 changed files with 14 additions and 3 deletions

View File

@@ -50,9 +50,12 @@ function parseNoteContent(content: string, mentions: MastodonMention[]): ParsedN
const name = mention?.acct ?? npub.substring(0, 8);
const href = mention?.url ?? Conf.local(`/@${acct}`);
return html`<span class="h-card"><a class="u-url mention" href="${href}" rel="ugc">@<span>${name}</span></a></span>${extra}`;
} else {
return '';
}
} else {
return content;
}
return content;
}
} catch {
// fallthrough