from app import app
from markupsafe import Markup
from markdown import markdown
from werkzeug.utils import escape

@app.template_filter('md')
def md(text):
    """
    Converts markdown to html5
    """
    # Escape html chars because markdown does not
    safe = escape(text)
    return Markup(markdown(safe))
