"""
Renders the text through the Markdown processor
"""
- def render(self, text):
+ def render(self, text, pre=False):
+ # Do nothing for no input
+ if text is None:
+ text = ""
+
# Pass the text through a markdown processor
- if text:
+ if not pre and text:
text = markdown.markdown(text,
extensions=[
PrettyLinksExtension(),
"sane_lists",
])
- return self.render_string("modules/text.html", text=text)
+ return self.render_string("modules/text.html", text=text, pre=pre)
class PrettyLinksExtension(markdown.extensions.Extension):