From 04f3e83307b355462b13627853045b0172d2c6dc Mon Sep 17 00:00:00 2001 From: Rico Hoppe Date: Tue, 7 May 2024 21:11:28 +0000 Subject: [PATCH] wiki.py: make regex for user mentions only match the mention * fixes bug 13682 * the regex for user mentions used to match whitespace in front of the @ symbol. Through using \B it stops matching "any non word charakter" and only matches @'s after non-word boundaries. Signed-off-by: Rico Hoppe Signed-off-by: Michael Tremer --- src/backend/wiki.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/backend/wiki.py b/src/backend/wiki.py index 706b1822..56d15cfd 100644 --- a/src/backend/wiki.py +++ b/src/backend/wiki.py @@ -995,7 +995,7 @@ class CVELinksPreprocessor(markdown.preprocessors.Preprocessor): class UserMentionPreprocessor(markdown.preprocessors.Preprocessor): - regex = re.compile(r"\W@(\w+)") + regex = re.compile(r"\B@(\w+)") def run(self, lines): for line in lines: -- 2.47.2