API Reference

mistune.html(text)
Parameters:text – markdown formatted text

Turn markdown text into HTML without escaping. For instance:

text = '**hello** <span>world</span>'
mistune.html(text)

# =>
'<p><strong>hello</strong> <span>world</span></p>'
mistune.create_markdown(escape=True, renderer=None, plugins=None)

Create a Markdown instance based on the given condition.

Parameters:
  • escape – Boolean. If using html renderer, escape html.
  • renderer – renderer instance or string of html and ast.
  • plugins – List of plugins, string or callable.

This method is used when you want to re-use a Markdown instance:

markdown = create_markdown(
    escape=False,
    renderer='html',
    plugins=['url', 'strikethrough', 'footnotes', 'table'],
)
# re-use markdown function
markdown('.... your text ...')