From ffbae701785c490a665b62c25d1b67f57fc13bc6 Mon Sep 17 00:00:00 2001 From: Lim Chee Aun Date: Fri, 19 Apr 2024 08:41:16 +0800 Subject: [PATCH] Remove newline from regex for shortcode --- src/components/compose.jsx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/components/compose.jsx b/src/components/compose.jsx index 76a9c61..49f9a84 100644 --- a/src/components/compose.jsx +++ b/src/components/compose.jsx @@ -131,7 +131,7 @@ const HASHTAG_RE = new RegExp( // https://github.com/mastodon/mastodon/blob/23e32a4b3031d1da8b911e0145d61b4dd47c4f96/app/models/custom_emoji.rb#L31 const SHORTCODE_RE_FRAGMENT = '[a-zA-Z0-9_]{2,}'; const SCAN_RE = new RegExp( - `([^A-Za-z0-9_:\\n]|^)(:${SHORTCODE_RE_FRAGMENT}:)(?=[^A-Za-z0-9_:]|$)`, + `(^|[^=\\/\\w])(:${SHORTCODE_RE_FRAGMENT}:)(?=[^A-Za-z0-9_:]|$)`, 'g', );