Strip query from Hashtag objects href property for platform that don't use the same href in the content (pixelfed).

various-fixes
Alain St-Denis 2023-02-22 15:08:22 -05:00
rodzic 0e9a74e088
commit 3798d9ddb9
1 zmienionych plików z 7 dodań i 1 usunięć

Wyświetl plik

@ -840,7 +840,13 @@ class Note(Object, RawContentMixin):
def remove_tag_links(attrs, new=False):
# Hashtag object hrefs
href = (None, "href")
if attrs.get(href, "").lower() in hrefs:
url = attrs.get(href, "").lower()
if url in hrefs:
return
# one more time without the query (for pixelfed)
parsed = urlparse(url)
url = f'{parsed.scheme}://{parsed.netloc}{parsed.path}'
if url in hrefs:
return
# Mastodon