From a65c65264707e246be797ceac3de30710fbad125 Mon Sep 17 00:00:00 2001 From: Mateusz Piotrowski Date: Sat, 7 Oct 2017 22:29:28 +0200 Subject: [PATCH] Add Markdown support to item descriptions --- requirements.txt | 1 + spejstore/settings.py | 1 + storage/templates/item.html | 5 ++++- 3 files changed, 6 insertions(+), 1 deletion(-) diff --git a/requirements.txt b/requirements.txt index 4b310c5..87bac65 100644 --- a/requirements.txt +++ b/requirements.txt @@ -13,3 +13,4 @@ djangorestframework-hstore==1.3 pyldap==2.4.28 requests==2.16.5 urllib3==1.21.1 +django_markdown2==0.3.0 diff --git a/spejstore/settings.py b/spejstore/settings.py index 93ec4c7..afbc249 100644 --- a/spejstore/settings.py +++ b/spejstore/settings.py @@ -43,6 +43,7 @@ INSTALLED_APPS = [ 'tree', 'django_select2', 'rest_framework', + 'django_markdown2', 'storage', ] diff --git a/storage/templates/item.html b/storage/templates/item.html index 31c4c82..03401c7 100644 --- a/storage/templates/item.html +++ b/storage/templates/item.html @@ -71,7 +71,10 @@
- {{ item.description|urlize }} + {% if item.description %} + {% load md2 %} + {{ item.description|markdown:"code-color" }} + {% endif %}

Children