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 } }) }