markdown in html - trentm/python-markdown2 GitHub Wiki

markdown-in-html extra

The markdown-in-html extra allows for the use of the markdown="1" attribute in a block HTML tag, to have markdown processing be done on its contents. It is similar to the PHP Markdown-Attr Extra but with some limitations.

From version 2.4.13, putting Markdown syntax on the same line as the block-level HTML is supported. Prior to this, the HTML tags had to be on separate lines to the Markdown for this to work.

command-line usage

$ cat foo.txt
<div markdown='1'>
This is a **bold statement**.
</div>
$ markdown2 -x markdown-in-html foo.txt
<div>

<p>This is a <strong>bold statement</strong>.</p>

</div>

(Return to Extras page.)

⚠️ **GitHub.com Fallback** ⚠️