mirror of
https://github.com/hzrd149/nostrudel.git
synced 2025-04-09 20:29:17 +02:00
fix hashtags and links with mark char
This commit is contained in:
parent
5d66750768
commit
5ac4cfcb33
5
.changeset/bright-gifts-nail.md
Normal file
5
.changeset/bright-gifts-nail.md
Normal file
@ -0,0 +1,5 @@
|
||||
---
|
||||
"nostrudel": patch
|
||||
---
|
||||
|
||||
Fix hashtags and links with mark characters in them
|
@ -19,7 +19,7 @@ export default function OpenGraphCard({ url, ...props }: { url: URL } & Omit<Car
|
||||
|
||||
const link = (
|
||||
<Link href={url.toString()} isExternal color="blue.500">
|
||||
{url.toString()}
|
||||
{decodeURI(url.toString())}
|
||||
</Link>
|
||||
);
|
||||
|
||||
|
@ -1,8 +1,7 @@
|
||||
export const getMatchNostrLink = () =>
|
||||
/(nostr:|@)?((npub|note|nprofile|nevent|nrelay|naddr)1[qpzry9x8gf2tvdw0s3jn54khce6mua7l]{58,})/gi;
|
||||
export const getMatchHashtag = () => /(^|[^\p{L}])#([\p{L}\p{N}]+)/gu;
|
||||
export const getMatchLink = () =>
|
||||
/https?:\/\/([a-zA-Z0-9\.\-]+\.[a-zA-Z]+)([\p{Letter}\p{Number}&\.-\/\?=#\-@%\+_,:!]*)/gu;
|
||||
export const getMatchHashtag = () => /(^|[^\p{L}])#([\p{L}\p{N}\p{M}]+)/gu;
|
||||
export const getMatchLink = () => /https?:\/\/([a-zA-Z0-9\.\-]+\.[a-zA-Z]+)([\p{L}\p{N}\p{M}&\.-\/\?=#\-@%\+_,:!]*)/gu;
|
||||
export const getMatchEmoji = () => /:([a-zA-Z0-9_-]+):/gi;
|
||||
export const getMatchCashu = () => /cashuA[A-z0-9]+/g;
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user