From bacbce9b51780f914dd0264ac66ef33c338991e9 Mon Sep 17 00:00:00 2001 From: berk76 Date: Fri, 25 Oct 2024 22:33:11 +0200 Subject: [PATCH] Remove markdown support from faults (#105) --- requirements.txt | 1 - svjis/articles/templates/fault.html | 2 +- svjis/articles/templatetags/article_filters.py | 8 -------- 3 files changed, 1 insertion(+), 10 deletions(-) diff --git a/requirements.txt b/requirements.txt index aada24c..98fc8d0 100644 --- a/requirements.txt +++ b/requirements.txt @@ -1,5 +1,4 @@ django==5.1.2 -markdown==3.7 django-tinymce==4.1.0 openpyxl==3.1.5 psycopg==3.2.3 diff --git a/svjis/articles/templates/fault.html b/svjis/articles/templates/fault.html index 9a48236..bb358ac 100644 --- a/svjis/articles/templates/fault.html +++ b/svjis/articles/templates/fault.html @@ -48,7 +48,7 @@

{% trans 'Description' %} - {{ obj.description | markdown | highlight:search | safe }} + {{ obj.description | replace_url_to_link | linebreaks | highlight:search | safe }} diff --git a/svjis/articles/templatetags/article_filters.py b/svjis/articles/templatetags/article_filters.py index 555079d..030f9f1 100644 --- a/svjis/articles/templatetags/article_filters.py +++ b/svjis/articles/templatetags/article_filters.py @@ -1,21 +1,13 @@ from django import template from django.utils.safestring import mark_safe from django.utils.translation import gettext as gt -from django.template.defaultfilters import stringfilter from django.conf import settings -import markdown as md import re from re import IGNORECASE, compile register = template.Library() -@register.filter() -@stringfilter -def markdown(value): - return md.markdown(value, extensions=['markdown.extensions.fenced_code']) - - @register.filter() def highlight(text, search): if search == '':