summaryrefslogtreecommitdiffstats
path: root/activities
diff options
context:
space:
mode:
Diffstat (limited to 'activities')
-rw-r--r--activities/models/post.py6
1 files changed, 5 insertions, 1 deletions
diff --git a/activities/models/post.py b/activities/models/post.py
index 5ca5a1b..daf61e8 100644
--- a/activities/models/post.py
+++ b/activities/models/post.py
@@ -279,8 +279,12 @@ class Post(StatorModel):
def replacer(match):
precursor = match.group(1)
handle = match.group(2).lower()
+ if "@" in handle:
+ short_handle = handle.split("@", 1)[0]
+ else:
+ short_handle = handle
if handle in possible_matches:
- return f'{precursor}<a href="{possible_matches[handle]}">@{handle}</a>'
+ return f'{precursor}<a href="{possible_matches[handle]}">@{short_handle}</a>'
else:
return match.group()