1
0
Fork 0

Render hashtag links with data-mention="hashtag" attribute

This commit is contained in:
Christof Dorner 2023-02-18 00:18:32 +01:00
parent 276b255f32
commit f3334b1550
5 changed files with 13 additions and 7 deletions

View file

@ -123,7 +123,8 @@ class CreateStatus(View):
# turn the mention into a link
content = re.sub(
rf"{mention_text}\b(?!@)",
rf'<a href="{mention_hashtag.remote_id}">{mention_text}</a>',
rf'<a href="{mention_hashtag.remote_id}" data-mention="hashtag">'
+ rf"{mention_text}</a>",
content,
)