+ def rendered(self, content):
+ return auto_user_link(self, self._as_markdown(content, *['auto_linker']))
+
+ @classmethod
+ def _as_markdown_raw(cls, content, *extensions):
+ try:
+ return mark_safe(sanitize_html(markdown.markdown(content, extensions=extensions)))
+ except Exception, e:
+ import traceback
+ logging.error("Caught exception %s in markdown parser rendering %s %s:\s %s" % (
+ str(e), cls.__name__, str(e), traceback.format_exc()))
+ return ''
+
+ # Replace \ with \\ to preserve backslashes during markdown processing