diff --git a/app/app.py b/app/app.py
index b9a7f64..5a57b64 100755
--- a/app/app.py
+++ b/app/app.py
@@ -308,6 +308,7 @@ def get_posts_from_select(cursor, select, binds):
add_media_html_to_posts(posts)
add_subreddits_to_posts(posts)
add_age_to_posts(posts)
+ reformat_body(posts)
return posts
def add_media_html_to_posts(posts):
@@ -339,6 +340,12 @@ def add_age_to_posts(posts):
else:
post["age"] = str(int(diff//(3600*24)))+'d'
+def reformat_body(posts):
+ for post in posts:
+ if "body" in post and post["body"] is not None:
+ post["body"] = post["body"].rstrip().replace("\n", "
")
+ post["body"] = re.sub(r"\[(.*?)\]\((.*?)\)", r'\1', post["body"])
+
def get_media_html(file, priority=False):
if file.endswith('.jpg') or file.endswith('.jpeg') or file.endswith('.png') or file.endswith('.gif'):
diff --git a/app/templates/index.html b/app/templates/index.html
index b37ec6c..26b7c52 100755
--- a/app/templates/index.html
+++ b/app/templates/index.html
@@ -243,7 +243,7 @@
{% endif %}
{% if post.body %}