mirror of
https://gitlab.com/brutaldon/brutaldon
synced 2024-12-29 17:20:00 +01:00
Fix more formatting issues on tag relinking
This commit is contained in:
parent
d9de6d7c85
commit
9c038a35dd
@ -33,7 +33,7 @@
|
|||||||
</p>
|
</p>
|
||||||
{% endif %}
|
{% endif %}
|
||||||
<div class="toot">
|
<div class="toot">
|
||||||
{{ toot.content | strip_html |relink_toot | safe }}
|
{{ toot.content | relink_toot | strip_html | safe }}
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
{% if toot.media_attachments %}
|
{% if toot.media_attachments %}
|
||||||
|
@ -18,7 +18,7 @@ def relink_tags(value):
|
|||||||
soup = BeautifulSoup(value, 'html.parser')
|
soup = BeautifulSoup(value, 'html.parser')
|
||||||
for link in soup.find_all('a', class_='hashtag'):
|
for link in soup.find_all('a', class_='hashtag'):
|
||||||
link['href'] = reverse('tag', args=[link.span.string])
|
link['href'] = reverse('tag', args=[link.span.string])
|
||||||
return soup.prettify(formatter=None)
|
return soup.decode(formatter=None)
|
||||||
|
|
||||||
@register.filter
|
@register.filter
|
||||||
def relink_toot(value):
|
def relink_toot(value):
|
||||||
|
Loading…
Reference in New Issue
Block a user