Fix some formatting issues introduced by hashtag parsing

This commit is contained in:
Jason McBrayer 2018-05-07 09:15:22 -04:00
parent 8aaef481ea
commit d9de6d7c85
2 changed files with 2 additions and 2 deletions

View File

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

View File

@ -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 str(soup) return soup.prettify(formatter=None)
@register.filter @register.filter
def relink_toot(value): def relink_toot(value):