From fe856bcf2c69d5c806bb78a26ac5c5f53fedb5d9 Mon Sep 17 00:00:00 2001 From: Mouse Reeve Date: Wed, 29 Mar 2023 09:20:58 -0700 Subject: [PATCH] Updates regex on mentions and hashtags --- bookwyrm/views/status.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/bookwyrm/views/status.py b/bookwyrm/views/status.py index 0e4d4e396..3c5b7bcf3 100644 --- a/bookwyrm/views/status.py +++ b/bookwyrm/views/status.py @@ -143,7 +143,7 @@ def format_mentions(content, mentions): for (mention_text, mention_user) in mentions.items(): # turn the mention into a link content = re.sub( - rf"{mention_text}\b(?!@)", + rf"(?{mention_text}', content, ) @@ -155,7 +155,7 @@ def format_hashtags(content, hashtags): for (mention_text, mention_hashtag) in hashtags.items(): # turn the mention into a link content = re.sub( - rf"{mention_text}\b(?!@)", + rf"(?' + rf"{mention_text}", content,