From 398cbbefac4aae3aafbd75473c61eabdec81ae6a Mon Sep 17 00:00:00 2001 From: Lim Chee Aun Date: Sat, 8 Feb 2025 12:25:00 +0800 Subject: [PATCH] Allow more chars in hashtag regex Still best-effort for now --- src/components/compose.jsx | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/components/compose.jsx b/src/components/compose.jsx index 2a4dca8fe..e11f16d37 100644 --- a/src/components/compose.jsx +++ b/src/components/compose.jsx @@ -142,8 +142,8 @@ const MENTION_RE = new RegExp( // AI-generated, all other regexes are too complicated const HASHTAG_RE = new RegExp( - `(^|[^=\\/\\w])(#[a-z0-9_]+([a-z0-9_.]+[a-z0-9_]+)?)(?![\\/\\w])`, - 'ig', + `(^|[^=\\/\\w])(#[\\p{L}\\p{N}_]+([\\p{L}\\p{N}_.]+[\\p{L}\\p{N}_]+)?)(?![\\/\\w])`, + 'iug', ); // https://github.com/mastodon/mastodon/blob/23e32a4b3031d1da8b911e0145d61b4dd47c4f96/app/models/custom_emoji.rb#L31