Render hashtag links with data-mention="hashtag" attribute
This commit is contained in:
parent
276b255f32
commit
f3334b1550
5 changed files with 13 additions and 7 deletions
|
@ -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,
|
||||
)
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue