summaryrefslogtreecommitdiff
path: root/app/books/models.py
diff options
context:
space:
mode:
authorluxagraf <sng@luxagraf.net>2015-12-03 16:24:36 -0500
committerluxagraf <sng@luxagraf.net>2015-12-03 16:24:36 -0500
commite4a7f290d373427c36d7925e7381aadf16524936 (patch)
treef38fe76393ddac2d77f653a109ac360fa2fb75d1 /app/books/models.py
parent657d719bfdc33c8b01a430ea3f58a4907c558f9d (diff)
switched over to using a single markdown processor from utils everywhere
except notes because I'm urlizing notes and I don't want to do that anywhere else.
Diffstat (limited to 'app/books/models.py')
-rw-r--r--app/books/models.py5
1 files changed, 2 insertions, 3 deletions
diff --git a/app/books/models.py b/app/books/models.py
index f5a4a04..d6cd9cf 100644
--- a/app/books/models.py
+++ b/app/books/models.py
@@ -4,8 +4,7 @@ from django.utils.encoding import force_text
from django.conf import settings
from django.template.defaultfilters import slugify
-# http://freewisdom.org/projects/python-markdown/
-import markdown
+from utils.widgets import markdown_to_html
class Book(models.Model):
@@ -59,7 +58,7 @@ class Book(models.Model):
def save(self, *args, **kwargs):
if self.body_markdown:
- self.body_html = markdown.markdown(self.body_markdown, extensions=['extra'], safe_mode=False)
+ self.body_html = markdown_to_html(self.body_markdown)
self.slug = slugify(self.title[:50])
super(Book, self).save()