Enable finding existing hashtags case-insensitive
We should store hashtags case-sensitive, but ensures that an existing hashtag with different case are found and re-used. for example, an existing #BookWyrm hashtag will be found and used even if the status content is using #bookwyrm.
This commit is contained in:
parent
f3334b1550
commit
9ca9883e0b
4 changed files with 41 additions and 27 deletions
|
@ -65,6 +65,7 @@ class Note(ActivityObject):
|
|||
rf'(<a href=")[^"]*(" data-mention="hashtag">{hashtag.name}</a>)',
|
||||
rf"\1{hashtag.remote_id}\2",
|
||||
instance.content,
|
||||
flags=re.IGNORECASE,
|
||||
)
|
||||
if instance.content != updated_content:
|
||||
instance.content = updated_content
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue