fix unknown tag error from notes

This commit is contained in:
Martti Malmi 2023-12-15 10:17:13 +02:00
parent a4570084ef
commit 57c0998eaa

View File

@ -185,10 +185,14 @@ function extractTagRefs(fragments: Fragment[], tags: Array<Array<string>>) {
if (i.startsWith("#")) { if (i.startsWith("#")) {
const tag = tags[Number(i.slice(2, -1))]; const tag = tags[Number(i.slice(2, -1))];
if (tag) { if (tag) {
try {
return { return {
type: "mention", type: "mention",
content: `nostr:${NostrLink.fromTag(tag).encode()}`, content: `nostr:${NostrLink.fromTag(tag).encode()}`,
} as ParsedFragment; } as ParsedFragment;
} catch (e) {
// ignore
}
} }
} }
return i; return i;