From 5dd070b04394d0a6321a8b1e5b39f28c728b1f43 Mon Sep 17 00:00:00 2001 From: MatthiasSaihttam Date: Thu, 14 Oct 2021 12:45:09 -0400 Subject: [PATCH] Remove markdown I can't take it. --- main/static/main/main.css | 1 + main/templates/whispermaphone/index.html | 53 +----------------------- main/templatetags/markdown.py | 5 +++ 3 files changed, 8 insertions(+), 51 deletions(-) diff --git a/main/static/main/main.css b/main/static/main/main.css index 3c6a78e..00d0a63 100644 --- a/main/static/main/main.css +++ b/main/static/main/main.css @@ -102,6 +102,7 @@ textarea::placeholder, input[type="text"]::placeholder { .text, .thought-end { max-width: 100%; line-height: 1.5em; + font-family: inherit; } .main-text, .main-text p:last-child { diff --git a/main/templates/whispermaphone/index.html b/main/templates/whispermaphone/index.html index 566c131..2d7348f 100644 --- a/main/templates/whispermaphone/index.html +++ b/main/templates/whispermaphone/index.html @@ -32,19 +32,18 @@ {% endif %} {% load tz %} - {% load markdown %} {% for thought in thoughts %}
- {{ thought.text|markdown }} +
{{ thought.text }}
{% with file_type=thought.get_media_type %} {% if file_type or thought.extended_text.strip %}
{% if thought.extended_text.strip %} - {{ thought.extended_text|markdown }} +
{{ thought.extended_text }}
{% endif %} {% if file_type == "png" or file_type == "jpeg" %} {{ thought.media_alt }} @@ -125,52 +124,4 @@ } } - -{# #} -{# #} - - - - - {% endblock %} diff --git a/main/templatetags/markdown.py b/main/templatetags/markdown.py index 308997a..9c9e91d 100644 --- a/main/templatetags/markdown.py +++ b/main/templatetags/markdown.py @@ -20,3 +20,8 @@ def markdown(value, autoescape=True): # html = value md.reset() return html + +@register.filter(needs_autoescape=True) +def nl_br(value, autoescape=True): + html = mark_safe(value.replace("\n", "
")) + return html