Commit 6405f2f3 authored by gijs's avatar gijs

Migration to new python markdown 3

parent 9533ad84
......@@ -180,11 +180,11 @@ class PageAdmin(admin.ModelAdmin):
}),
('Dutch', {
'classes': (),
'fields': ('title', 'menu_label', 'content')
'fields': ('title', 'content')
}),
('English', {
'classes': (),
'fields': ('title_en', 'menu_label_en', 'content_en')
'fields': ('title_en', 'content_en')
})
)
......
......@@ -69,7 +69,7 @@ def markdown_filter(value):
extensions = ["extra", ]
return mark_safe(markdown.markdown(force_text(value),
extensions))
extensions=extensions))
p_surrounds = re.compile(r'<p>(.*)</p>')
......
......@@ -13,6 +13,8 @@ import os
# PyPi imports
import markdown
from markdown.extensions.toc import TocExtension
from py_etherpad import EtherpadLiteClient
import dateutil.parser
import pytz
......@@ -306,7 +308,7 @@ def pad_read(request, mode="r", slug=None):
# we don’t want Etherpads automatically generated HTML, we want plain text.
text = epclient.getText(padID)['text']
if extension in ['.md', '.markdown']:
md = markdown.Markdown(extensions=['extra', 'meta', 'headerid(level=2)', 'attr_list', 'figcaption'])
md = markdown.Markdown(extensions=['extra', 'meta', TocExtension(baselevel=2), 'attr_list', 'figcaption'])
text = md.convert(text)
try:
meta = md.Meta
......
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