Skip to content

Commit a6d043e

Browse files
committed
Switched to use server-side markdown rendering...
1 parent d96152b commit a6d043e

File tree

3 files changed

+15
-6
lines changed

3 files changed

+15
-6
lines changed

dbdb/settings.py

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -26,6 +26,8 @@
2626
'easy_thumbnails',
2727
'django_countries',
2828
'haystack', # django-haystack
29+
'rest_framework', # djangorestframework
30+
'markdownify.apps.MarkdownifyConfig',
2931

3032
'dbdb.core'
3133
]
@@ -206,3 +208,9 @@
206208
# Django Invisible reCaptcha
207209
NORECAPTCHA_SITE_KEY = '6Lfo8VwUAAAAAEHNqeL01PSkiRul7ImQ8Bsw8Nqc'
208210
NORECAPTCHA_SECRET_KEY = '6Lfo8VwUAAAAALFGUrGKqrzCR94pfgFahtd56WY9'
211+
212+
MARKDOWNIFY = {
213+
"default": {
214+
"BLEACH": False
215+
}
216+
}

requirements.txt

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -45,3 +45,4 @@ sphinxcontrib-websupport==1.2.2
4545
sqlparse==0.3.1
4646
urllib3==1.25.9
4747
zipp==3.1.0
48+
django-markdownify==0.9.0

templates/core/system_base.html

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
{% extends 'base.html' %}
22
{% load static %}
33
{% load thumbnail %}
4+
{% load markdownify %}
45

56
{% block css %}
67
<link href="{% static 'core/css/system.css' %}" rel="stylesheet">
@@ -42,7 +43,9 @@ <h2 class="card-title">
4243
{{ system.name }}
4344
<a href="javascript:;" class="citations"><i class="fas fa-info-circle" title="Citations"></i></a>
4445
</h2>
45-
<p class="card-text markdown-area">{{ system_version.description }}</p>
46+
<p class="card-text">
47+
{{ system_version.description|markdownify }}
48+
</p>
4649
<cite class="hidden">
4750
<ul>
4851
{% for citation in system_version.description_citations.all %}
@@ -60,7 +63,7 @@ <h4 class="card-title">
6063
History
6164
<a href="javascript:;" class="citations"><i class="fas fa-info-circle" title="Citations"></i></a>
6265
</h4>
63-
<p class="card-text markdown-area">{{ system_version.history }}</p>
66+
<p class="card-text">{{ system_version.history|markdownify }}</p>
6467
<cite class="hidden">
6568
<ul>
6669
{% for citation in system_version.history_citations.all %}
@@ -85,9 +88,7 @@ <h4 class="card-title">
8588
<a class="badge badge-info" href="{% url 'browse' %}?{{ feature.feature.slug }}={{ v.slug }}">{{ v.value }}</a>
8689
{% endfor %}
8790
</p>
88-
<p class="markdown-area">
89-
{{ feature.description }}
90-
</p>
91+
<p>{{ feature.description|markdownify }}</p>
9192
<cite class="hidden">
9293
<ul>
9394
{% for citation in feature.citations.all %}
@@ -379,7 +380,6 @@ <h6 class="card-title">Publications</h6>
379380
{% endblock %}
380381

381382
{% block scripts %}
382-
<script src="{% static 'lib/js/markdown.min.js' %}"></script>
383383
<script src="{% static 'lib/js/bootstrap.bundle.js' %}"></script>
384384

385385
{% block system_script %}{% endblock %}

0 commit comments

Comments
 (0)