From 828ac3a624449228a3c2ce5f4eeb2364702810b2 Mon Sep 17 00:00:00 2001 From: thePR0M3TH3AN <53631862+PR0M3TH3AN@users.noreply.github.com> Date: Tue, 9 Jun 2026 10:37:07 -0400 Subject: [PATCH] Tolerate whitespace in pasted event ID lookups The Load Event field requires 64 contiguous hex chars, but the event ID printed on a tear-off tab wraps across two lines, so copying it back in pastes as two 32-char halves separated by a newline/space and failed to match. Strip inner whitespace before matching the raw hex id, which also tolerates a pasted "Event ID:" label prefix. naddr/note/nevent inputs are unaffected. Co-Authored-By: Claude Opus 4.8 --- site/nostr/nostr-client.js | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/site/nostr/nostr-client.js b/site/nostr/nostr-client.js index bcf8194..6f22332 100644 --- a/site/nostr/nostr-client.js +++ b/site/nostr/nostr-client.js @@ -1581,7 +1581,11 @@ Join us in a revolution that values truth and transparency. Together, we can bui if (!raw) return null; try { const decoded = decodeURIComponent(raw); - const rawId = decoded.match(/\b[a-f0-9]{64}\b/i); + // A 64-char hex event id is often copied with whitespace or a line break + // in the middle (e.g. the two-line event ID printed on a tear-off tab, or + // a label like "Event ID: ..."), so match against the input with inner + // whitespace removed. + const rawId = decoded.replace(/\s+/g, "").match(/\b[a-f0-9]{64}\b/i); if (rawId) return { type: "event", id: rawId[0].toLowerCase(), relays: [] }; const nipMatch = decoded.match(/(?:nostr:)?((?:note1|nevent1|naddr1)[023456789acdefghjklmnpqrstuvwxyz]+)/i); if (!nipMatch) return null;