Wrap outbound HTML mention links in span

This is Mastodon specific, but what can we do than copy the
biggest for greater compatibility.
merge-requests/159/head
Jason Robinson 2020-02-17 22:16:59 +02:00
rodzic 9cb2509ab6
commit 1e3de327c3
2 zmienionych plików z 2 dodań i 2 usunięć

Wyświetl plik

@ -218,7 +218,7 @@ class RawContentMixin(BaseEntity):
display_name = mention
rendered = rendered.replace(
"@{%s}" % mention,
f'@<a href="{mention}" class="mention">{display_name}</a>',
f'@<a href="{mention}" class="mention"><span>{display_name}</span></a>',
)
# Finally linkify remaining URL's that are not links
rendered = process_text_links(rendered)

Wyświetl plik

@ -181,7 +181,7 @@ class TestEntitiesConvertToAS2:
'attributedTo': 'http://127.0.0.1:8000/profile/123456/',
'content': '<h1>raw_content</h1>\n<p>@{someone@localhost.local} @<a class="mention" '
'href="http://localhost.local/someone" rel="nofollow" target="_blank">'
'Bob Bobértson</a></p>',
'<span>Bob Bobértson</span></a></p>',
'published': '2019-04-27T00:00:00',
'inReplyTo': None,
'sensitive': False,