From cbac9c5464d1a09082f604392f90cc17d7b0536f Mon Sep 17 00:00:00 2001 From: codytseng Date: Sat, 30 Aug 2025 22:23:51 +0800 Subject: [PATCH] fix: update regex --- src/constants.ts | 8 ++------ src/lib/tiptap.ts | 10 ++++++---- 2 files changed, 8 insertions(+), 10 deletions(-) diff --git a/src/constants.ts b/src/constants.ts index 26ddedbc..32a5f692 100644 --- a/src/constants.ts +++ b/src/constants.ts @@ -95,13 +95,9 @@ export const SUPPORTED_KINDS = [ ] export const URL_REGEX = - /https?:\/\/[\w\p{L}\p{N}\p{M}&.-/?=#\-@%+_:!~*]+(? { + const _match = match.trim() try { - nip19.decode(match) - return `nostr:${match}` + nip19.decode(_match) + return `nostr:${_match}` } catch { - return match + return _match } }) }