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, hard_wrap=False, renderer=None, plugins=None)

Create a Markdown instance based on the given condition.

Parameters:
  • escape – Boolean. If using html renderer, escape html.
  • hard_wrap – Boolean. Break every new line into <br>.
  • 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 ...')