]> git.openstreetmap.org Git - osqa.git/blobdiff - forum/models/node.py
Adds the option to create static pages with several options to customize its behaviour.
[osqa.git] / forum / models / node.py
index bf05cb54beb0f24be0ec6d6daf6ee886c5f35aa4..b0f53612493f57952ba91fc9bfa653e3fd46f6ae 100644 (file)
@@ -23,8 +23,12 @@ class NodeContent(models.Model):
     def html(self):
         return self.as_markdown()
 
+    @classmethod
+    def _as_markdown(cls, content, *extensions):
+        return mark_safe(sanitize_html(markdown.markdown(content, extensions=extensions)))
+
     def as_markdown(self, *extensions):
-        return mark_safe(sanitize_html(markdown.markdown(self.body, extensions=extensions)))
+        return self._as_markdown(self.body, *extensions)
 
     @property
     def headline(self):