From 9c038a35dd547c3009d79585ae0131c93730f3fd Mon Sep 17 00:00:00 2001
From: Jason McBrayer
Date: Mon, 7 May 2018 09:34:12 -0400
Subject: [PATCH] Fix more formatting issues on tag relinking
---
brutaldon/templates/main/toot_partial.html | 2 +-
brutaldon/templatetags/taglinks.py | 2 +-
2 files changed, 2 insertions(+), 2 deletions(-)
diff --git a/brutaldon/templates/main/toot_partial.html b/brutaldon/templates/main/toot_partial.html
index f7c2d17..0e8a8d6 100644
--- a/brutaldon/templates/main/toot_partial.html
+++ b/brutaldon/templates/main/toot_partial.html
@@ -33,7 +33,7 @@
{% endif %}
- {{ toot.content | strip_html |relink_toot | safe }}
+ {{ toot.content | relink_toot | strip_html | safe }}
{% if toot.media_attachments %}
diff --git a/brutaldon/templatetags/taglinks.py b/brutaldon/templatetags/taglinks.py
index fc3741a..1f35135 100644
--- a/brutaldon/templatetags/taglinks.py
+++ b/brutaldon/templatetags/taglinks.py
@@ -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):