[Glitch] Fix hashtags not being picked up when full-width hash sign is used

Port 779a1f8448 to glitch-soc

Co-authored-by: Claire <claire.github-309c@sitedethib.com>
Signed-off-by: Claire <claire.github-309c@sitedethib.com>
This commit is contained in:
Eugen Rochko
2025-10-27 18:18:01 +01:00
committed by Claire
parent 48ec31bec8
commit 0565eb62d6
4 changed files with 8 additions and 7 deletions

View File

@@ -1,6 +1,6 @@
export function recoverHashtags (recognizedTags, text) {
return recognizedTags.map(tag => {
const re = new RegExp(`(?:^|[^/)\\w])#(${tag.name})`, 'i');
const re = new RegExp(`(?:^|[^/)\\w])[#](${tag.name})`, 'i');
const matched_hashtag = text.match(re);
return matched_hashtag ? matched_hashtag[1] : null;
},