fix hashtags in search

This commit is contained in:
hzrd149 2023-08-15 10:22:02 -05:00
parent 1148093517
commit 4cb2b39f56
2 changed files with 2 additions and 2 deletions

View File

@ -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;

View File

@ -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;