symposion_app/symposion/markdown_parser.py
Hiroshi Miura d68e310089 fix pip8 warnings
Signed-off-by: Hiroshi Miura <miurahr@linux.com>
2015-10-17 10:57:18 +09:00

17 lines
453 B
Python

from __future__ import unicode_literals
import markdown
def parse(text):
# First run through the Markdown parser
text = markdown.markdown(text, extensions=["extra"], safe_mode=False)
# Sanitize using html5lib
# bits = []
# parser = html5parser.HTMLParser(tokenizer=sanitizer.HTMLSanitizer)
# for token in parser.parseFragment(text).childNodes:
# bits.append(token.toxml())
# return "".join(bits)
return text