mirror of
https://github.com/hzrd149/nostrudel.git
synced 2025-04-10 04:39:19 +02:00
fix hashtags in search
This commit is contained in:
parent
1148093517
commit
4cb2b39f56
@ -3,5 +3,5 @@ export const matchImageUrls =
|
||||
/https?:\/\/([\dA-z\.-]+\.[A-z\.]{2,12})((?:\/[\+~%\/\.\w\-_]*)?\.(?:svg|gif|png|jpg|jpeg|webp|avif))(\??(?:[\?#\-\+=&;%@\.\w_]*)#?(?:[\-\.\!\/\\\w]*))?/i;
|
||||
|
||||
export const matchNostrLink = /(nostr:|@)?((npub|note|nprofile|nevent)1[qpzry9x8gf2tvdw0s3jn54khce6mua7l]{58,})/gi;
|
||||
export const matchHashtag = /(^|[^\p{L}])#([\p{L}\p{N}]+)/giu;
|
||||
export const matchHashtag = /(^|[^\p{L}])#([\p{L}\p{N}]+)/gu;
|
||||
export const matchLink = /https?:\/\/([a-zA-Z0-9\.\-]+\.[a-zA-Z]+)([\p{Letter}\p{Number}&\.-\/\?=#\-@%\+_,:]*)/gu;
|
||||
|
@ -128,7 +128,7 @@ export function SearchPage() {
|
||||
return;
|
||||
}
|
||||
|
||||
const hashTagMatch = cleanText.match(matchHashtag);
|
||||
const hashTagMatch = matchHashtag.exec(cleanText);
|
||||
if (hashTagMatch) {
|
||||
navigate({ pathname: "/t/" + hashTagMatch[2].toLocaleLowerCase() });
|
||||
return;
|
||||
|
Loading…
x
Reference in New Issue
Block a user