Better (and documented) Support for markdown="1" #52

Closed
Mekk opened this Issue Nov 16, 2011 · 4 comments

Comments

Projects
None yet
4 participants
@Mekk

Mekk commented Nov 16, 2011

PHP Markdown allows one to use markdown inside HTML blocks - simply by adding markdown=1 attribute to appropriate HTML block.

It would be nice if python markdown also allowed for such a feature.

I faced the problem after migrating my blog from PHP to Python but seems I am not the only one. It is useful in cases like

<div class="blahblah" markdown="1">
Some *normal* markdown [text][] here.
</div>

or

<blockquote markdown="1">
Some *markdown text*

<pre name="code" class="python">
# code block which is to stay inside blockquote
</pre>

Yet another *markdown text*
</blockquote>
@waylan

This comment has been minimized.

Show comment Hide comment
@waylan

waylan Nov 16, 2011

Owner

PHP Markdown allows one to use markdown inside HTML blocks - simply by adding markdown=1 attribute to appropriate HTML block.

Actually, PHP Markdown Extra supports that feature -- as does the Extra Extension of Python-Markdown. Unfortunately, it is not documented as the feature doesn't work consistently due to limitations of our rudimentary html parser. Of course, patches are always welcome.

I should also note that unlike all other features of the Extra Extension, this feature is built right into the markdown core and is simply turned on with a flag by Extra. See the source for details.

Owner

waylan commented Nov 16, 2011

PHP Markdown allows one to use markdown inside HTML blocks - simply by adding markdown=1 attribute to appropriate HTML block.

Actually, PHP Markdown Extra supports that feature -- as does the Extra Extension of Python-Markdown. Unfortunately, it is not documented as the feature doesn't work consistently due to limitations of our rudimentary html parser. Of course, patches are always welcome.

I should also note that unlike all other features of the Extra Extension, this feature is built right into the markdown core and is simply turned on with a flag by Extra. See the source for details.

@waylan waylan closed this Nov 16, 2011

@waylan waylan reopened this Nov 16, 2011

@waylan

This comment has been minimized.

Show comment Hide comment
@waylan

waylan Nov 16, 2011

Owner

Upon further consideration, I'm reopening this as a "feature" to implement "someday-maybe". Note that I changed the title to: Better and documented Support for markdown="1"

Owner

waylan commented Nov 16, 2011

Upon further consideration, I'm reopening this as a "feature" to implement "someday-maybe". Note that I changed the title to: Better and documented Support for markdown="1"

@kaba2

This comment has been minimized.

Show comment Hide comment
@kaba2

kaba2 Sep 22, 2012

Hi,

I would like to encourage in implementing this feature. I am using Python Markdown in a documentation system which extends the capabilities of Markdown by macros. These macros construct things in Markdown and html, and embed them in html-div blocks, so that they can be styled by CSS. This works in Python Markdown 2.0 (well enough for me), but not in Python Markdown 2.2, so I am unable to upgrade.

Kalle

kaba2 commented Sep 22, 2012

Hi,

I would like to encourage in implementing this feature. I am using Python Markdown in a documentation system which extends the capabilities of Markdown by macros. These macros construct things in Markdown and html, and embed them in html-div blocks, so that they can be styled by CSS. This works in Python Markdown 2.0 (well enough for me), but not in Python Markdown 2.2, so I am unable to upgrade.

Kalle

@mentat-fr

This comment has been minimized.

Show comment Hide comment
@mentat-fr

mentat-fr Feb 20, 2013

Hi,

in my source file I put div for layout control.

Operation with the tag markdown = "1" works perfectly.

Except when another div is included inside div.
In this case python markdown put the div inside a paragraph.

Example:

<div markdown="1">

## Header

<div markdown="1">
    blabla **strong** ...
</div>

</div>

Output:

<div>

<h2>Header</h2>

<p><div markdown="1">
    blabla <strong>strong</strong> ...
</div></p>

</div>

As for php extra markdown, I use otherwise, the correct output is:

<div>

<h2>Header</h2>

<div>
    blabla <strong>strong</strong> ...
</div></p>

</div>

with no extra <p> and <div> markdown attribute.

Do you know how to fix this? (sorry I'have no Python skill ...)
Or can we expect a futur version with this behavior?

Many thanks.

Hi,

in my source file I put div for layout control.

Operation with the tag markdown = "1" works perfectly.

Except when another div is included inside div.
In this case python markdown put the div inside a paragraph.

Example:

<div markdown="1">

## Header

<div markdown="1">
    blabla **strong** ...
</div>

</div>

Output:

<div>

<h2>Header</h2>

<p><div markdown="1">
    blabla <strong>strong</strong> ...
</div></p>

</div>

As for php extra markdown, I use otherwise, the correct output is:

<div>

<h2>Header</h2>

<div>
    blabla <strong>strong</strong> ...
</div></p>

</div>

with no extra <p> and <div> markdown attribute.

Do you know how to fix this? (sorry I'have no Python skill ...)
Or can we expect a futur version with this behavior?

Many thanks.

waylan added a commit that referenced this issue Oct 14, 2013

Merge pull request #260 from ryneeverett/master
Issue #52 Patch -- Markdown Inside HTML Blocks

@waylan waylan closed this Feb 16, 2014

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment