Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Python Markdown: Markdown Inside HTML Blocks

Is there an extra for Python Markdown that supports Markdown inside HTML block elements, e.g. div, p

i.e. is there a way to convert this:

<div id="content">
    [Google](http://www.google.com)
</div>

to

<div id="content">
    <a href="http://www.google.com>Google</a>
</div>

using Python Markdown or a Python Markdown extension? I'm looking for something similar to this feature in PHP Markdown Extra

like image 217
Wei Avatar asked Nov 10 '09 05:11

Wei


2 Answers

According to this: http://daringfireball.net/projects/markdown/syntax#html

You would have to use a <span> rather than a <div>. Further explanation is available at the above link.

like image 160
Curt Micol Avatar answered Oct 02 '22 12:10

Curt Micol


The relevant bug report states that the extra extension adds that: https://github.com/waylan/Python-Markdown/issues/80

Then you can add markdown="1" to div tags to have markdown parsed inside

<div markdown="1">
*markdown*
</div>
like image 20
Arne Babenhauserheide Avatar answered Oct 02 '22 13:10

Arne Babenhauserheide