diff --git a/src/utils/note.ts b/src/utils/note.ts index 36ded28..6e0d8d4 100644 --- a/src/utils/note.ts +++ b/src/utils/note.ts @@ -16,7 +16,7 @@ const linkifyOpts: linkify.Opts = { const href = Conf.local(`/tags/${tag}`); return `#${tag}`; }, - url: ({ content }) => { + url: ({ attributes, content }) => { try { const { decoded } = nip21.parse(content); const pubkey = getDecodedPubkey(decoded); @@ -28,7 +28,11 @@ const linkifyOpts: linkify.Opts = { return ''; } } catch { - return `${content}`; + const attr = Object.entries(attributes) + .map(([name, value]) => `${name}="${value}"`) + .join(' '); + + return `${content}`; } }, },