kopia lustrzana https://gitlab.com/jaywink/federation
Also remove trailing garbage from hashtag text found in the rendered content.
rodzic
21184c368a
commit
2672eede39
|
@ -872,7 +872,7 @@ class Note(Object, RawContentMixin):
|
||||||
normalized_url = f'{parsed.scheme}://{parsed.netloc}{normalized_path.decode()}'
|
normalized_url = f'{parsed.scheme}://{parsed.netloc}{normalized_path.decode()}'
|
||||||
links = {link['href'].lower(), unquote(link['href']).lower(), url, normalized_url}
|
links = {link['href'].lower(), unquote(link['href']).lower(), url, normalized_url}
|
||||||
if links.intersection(hrefs):
|
if links.intersection(hrefs):
|
||||||
tag = re.match(r'^#?([\w\-]+$)', link.text)
|
tag = re.match(r'^#?([\w\-]+)', link.text)
|
||||||
if tag:
|
if tag:
|
||||||
link['data-hashtag'] = tag.group(1).lower()
|
link['data-hashtag'] = tag.group(1).lower()
|
||||||
|
|
||||||
|
|
Ładowanie…
Reference in New Issue