From b6618dd66a56b919d189d691fef2ad0a72c4c130 Mon Sep 17 00:00:00 2001 From: Scroogey-SN Date: Thu, 27 Feb 2025 21:24:09 +0000 Subject: [PATCH] Fix issue #1924, require nostr prefixes start with slash (#1928) --- lib/url.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/url.js b/lib/url.js index bd11697f..0322c72c 100644 --- a/lib/url.js +++ b/lib/url.js @@ -93,7 +93,7 @@ export function parseEmbedUrl (href) { const { hostname, pathname, searchParams } = new URL(href) // nostr prefixes: [npub1, nevent1, nprofile1, note1] - const nostr = href.match(/(?(?npub1|nevent1|nprofile1|note1|naddr1)[02-9ac-hj-np-z]+)/) + const nostr = href.match(/\/(?(?npub1|nevent1|nprofile1|note1|naddr1)[02-9ac-hj-np-z]+)/) if (nostr?.groups?.id) { let id = nostr.groups.id if (nostr.groups.type === 'npub1') {