summaryrefslogtreecommitdiff
path: root/app/pages/models.py
diff options
context:
space:
mode:
Diffstat (limited to 'app/pages/models.py')
-rw-r--r--app/pages/models.py13
1 files changed, 9 insertions, 4 deletions
diff --git a/app/pages/models.py b/app/pages/models.py
index 62976cd..3ef1a71 100644
--- a/app/pages/models.py
+++ b/app/pages/models.py
@@ -8,11 +8,16 @@ import yaml
from django.conf import settings
from django.template.loader import render_to_string
from django.template import Context
+from mdx_attr_list.mdx_attr_list import AttrListExtension
-def markdown_processor(md):
- return markdown.markdown(md, ['footnotes'], safe_mode=False)
-
+def markdown_processor(txt):
+ md = markdown.Markdown(
+ extensions=[AttrListExtension(),'footnotes',],
+ output_format='html5',
+ safe_mode=False
+ )
+ return md.convert(txt)
'''
class Page(models.Model):
title = models.CharField(max_length=200)
@@ -106,7 +111,7 @@ class _FileLoader(object):
for k, v in metadata.items():
setattr(self, k, v)
if self.body_markdown:
- self.body_html = markdown.markdown(self.body_markdown, ['footnotes'], safe_mode=False)
+ self.body_html = markdown_processor(self.body_markdown)
def read(self):
with open(self.filename, "r", encoding="utf-8") as f: