Commit cfb15d1a authored by BERJON Matthieu's avatar BERJON Matthieu
Browse files

Update of markdown converter



I replaced the markdown parser by misaka that is faster than mistune and
allow more configuration (especially related to code highlighting).
Signed-off-by: BERJON Matthieu's avatarMatthieu Berjon <matthieu.berjon@inria.fr>
parent 3ecbdb09
from django import template
import mistune
from misaka import Markdown, HtmlRenderer
register = template.Library()
......@@ -8,5 +7,13 @@ register = template.Library()
@register.filter(name='markdown')
def markdown(value):
""" Convert markdown content into HTML. """
markdown = mistune.Markdown()
renderer = HtmlRenderer()
markdown = Markdown(
renderer,
extensions=(
'fenced-code',
'footnotes',
'superscript',
'quote',
))
return markdown(value)
Django==1.11
mysqlclient==1.3.12
django-allauth==0.35.0
misaka==2.1.0
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment