Fix more formatting issues on tag relinking

This commit is contained in:
Jason McBrayer 2018-05-07 09:34:12 -04:00
parent d9de6d7c85
commit 9c038a35dd
2 changed files with 2 additions and 2 deletions

View File

@ -33,7 +33,7 @@
</p>
{% endif %}
<div class="toot">
{{ toot.content | strip_html |relink_toot | safe }}
{{ toot.content | relink_toot | strip_html | safe }}
</div>
{% if toot.media_attachments %}

View File

@ -18,7 +18,7 @@ def relink_tags(value):
soup = BeautifulSoup(value, 'html.parser')
for link in soup.find_all('a', class_='hashtag'):
link['href'] = reverse('tag', args=[link.span.string])
return soup.prettify(formatter=None)
return soup.decode(formatter=None)
@register.filter
def relink_toot(value):