Python Markdown: Markdown inside HTML blocks

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

i.e. There is 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 the Python Markdown extension? I am looking for something similar to this function in PHP Markdown Extra

+5
source share
3 answers

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

You will need to use <span> and not <div>. Further explanation is available at the above link.

+3
source

, , : https://github.com/waylan/Python-Markdown/issues/80

markdown = "1" div, ,

<div markdown="1">
*markdown*
</div>
+2

With PHP Markdown Extra (not Python, I know, but relevant), you can do this by adding an attribute markdown=1to the block level element.

I'm interested in pure-Python libraries that also support the Markdown Extra syntax.

Of course, one very efficient hack will call PHP and PHP Markdown Extra through standard input from your Python script.

+1
source

All Articles