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
|
@ -62,7 +62,7 @@ class Note(ActivityObject):
|
|||
changed_content = False
|
||||
for hashtag in instance.mention_hashtags.all():
|
||||
updated_content = re.sub(
|
||||
rf'(<a href=")[^"]*/hashtag/[^"]*(">{hashtag.name}</a>)',
|
||||
rf'(<a href=")[^"]*(" data-mention="hashtag">{hashtag.name}</a>)',
|
||||
rf"\1{hashtag.remote_id}\2",
|
||||
instance.content,
|
||||
)
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue