diff --git a/forums/templates/forums/post_card.html b/forums/templates/forums/post_card.html index 4e740b40c2603ff82019035e3e58d90b58bb1c40..da9085602e422ba7c6e1a63692d4015fcf3ac369 100644 --- a/forums/templates/forums/post_card.html +++ b/forums/templates/forums/post_card.html @@ -1,4 +1,4 @@ -{% load restructuredtext %} +{% load automarkup %} <div class="card m-2 {% if post.motion %}text-white bg-dark{% else %}text-body{% endif %}" id="post{{ post.id }}"> <div class="card-header"> @@ -12,7 +12,7 @@ </div> </div> <div class="card-body"> - {{ post.text|restructuredtext }} + {{ post.text|automarkup }} </div> <div class="card-footer"> <div class="d-flex flex-wrap justify-content-end align-items-center"> diff --git a/forums/templates/forums/post_confirm_create.html b/forums/templates/forums/post_confirm_create.html index ecfe1118e7c20ea157fc22e8a192522f32bcb169..cf151c8c1402a597cb0be1e90c1bb683ef78a03a 100644 --- a/forums/templates/forums/post_confirm_create.html +++ b/forums/templates/forums/post_confirm_create.html @@ -1,7 +1,7 @@ {% extends 'forums/base.html' %} {% load bootstrap %} -{% load restructuredtext %} +{% load automarkup %} {% block breadcrumb_items %} @@ -23,7 +23,7 @@ </div> <div class="card-body"> {% if form.initial.text %} - {{ form.initial.text|restructuredtext }} + {{ form.initial.text|automarkup }} {% else %} <span class="text-danger">No text given</span> {% endif %} diff --git a/forums/templates/forums/post_form.html b/forums/templates/forums/post_form.html index b78bd613d6ec3cb2beebf0fba4fd97ce2eaabf2f..75d62c0122653ef20de95d6388bef6d2543473af 100644 --- a/forums/templates/forums/post_form.html +++ b/forums/templates/forums/post_form.html @@ -1,8 +1,6 @@ {% extends 'forums/base.html' %} {% load bootstrap %} -{% load restructuredtext %} - {% block breadcrumb_items %} {{ block.super }} diff --git a/scipost/templatetags/restructuredtext.py b/scipost/templatetags/restructuredtext.py deleted file mode 100644 index 1bc890ffb31e2307563d20b66adff0cebe606c32..0000000000000000000000000000000000000000 --- a/scipost/templatetags/restructuredtext.py +++ /dev/null @@ -1,28 +0,0 @@ -__copyright__ = "Copyright © Stichting SciPost (SciPost Foundation)" -__license__ = "AGPL v3" - - -from django import template -from django.utils.encoding import force_text -from django.utils.safestring import mark_safe - - -register = template.Library() - - -@register.filter(name='restructuredtext') -def restructuredtext(text): - if not text: - return '' - from docutils.core import publish_parts - parts = publish_parts( - source=text, - writer_name='html5_polyglot', - settings_overrides={ - 'math_output': 'MathJax https://cdnjs.cloudflare.com/ajax/libs/mathjax/2.7.5/MathJax.js?config=TeX-MML-AM_CHTML,Safe', - 'initial_header_level': 1, - 'doctitle_xform': False, - 'raw_enabled': False, - 'file_insertion_enabled': False, - }) - return mark_safe(force_text(parts['html_body'])) diff --git a/templates/email/helpdesk/followup_on_ticket.html b/templates/email/helpdesk/followup_on_ticket.html index 16d0ea7035d6f16eb8848f68ca175867fd66db05..67baf4f617b37404fb331521960836ff72bc08ad 100644 --- a/templates/email/helpdesk/followup_on_ticket.html +++ b/templates/email/helpdesk/followup_on_ticket.html @@ -1,10 +1,10 @@ -{% load restructuredtext %} +{% load automarkup %} <p> Re: ticket {{ followup.ticket.title }} </p> <p>A followup has been posted by {{ followup.by.get_full_name }} on the ticket above:</p> <hr> -{{ followup.text|restructuredtext }} +{{ followup.text|automarkup }} <hr> <p>You can view details (and eventually take further steps) by navigating to the <a href="https://scipost.org{{ followup.ticket.get_absolute_url }}">ticket's page</a> (login required). You can also see this ticket on your personal list at our online <a href="https://scipost.org/helpdesk/">helpdesk</a>.</p> <p>