Revert "nip19: remove note1."

This reverts commit a8a805fb71.
This commit is contained in:
Asai Toshiya
2024-11-21 23:51:38 +09:00
committed by fiatjaf_
parent b22e2465cc
commit 2e85f7a5fe
6 changed files with 57 additions and 29 deletions

View File

@@ -9,7 +9,7 @@ type Reference = {
address?: AddressPointer
}
const mentionRegex = /\bnostr:((npub|naddr|nevent|nprofile)1\w+)\b|#\[(\d+)\]/g
const mentionRegex = /\bnostr:((note|npub|naddr|nevent|nprofile)1\w+)\b|#\[(\d+)\]/g
export function parseReferences(evt: Event): Reference[] {
let references: Reference[] = []
@@ -33,6 +33,13 @@ export function parseReferences(evt: Event): Reference[] {
})
break
}
case 'note': {
references.push({
text: ref[0],
event: { id: data as string, relays: [] },
})
break
}
case 'nevent': {
references.push({
text: ref[0],