Markdown allows to use inline HTML. Hovever, when inputting a paragraph enclosed in <pre> tags, the markdown filter additionally encloses it in <p> tags, which is not valid HTML code. The test environments at daringfireball as well as at php-markdown implement this behaviour correctly, however, the markdown module adds invalid (in html terms) <p> tags.
An example:
The markdown code:
A paragraph.
<pre>
Prefomatted
multi-line text
</pre>
should be translated to:
<p>A paragraph.</p>
<pre>
Prefomatted
multi-line text
</pre>
but with the markdown module (without any other activated input filter) it becomes:
<p>A paragraph.</p>
<p><pre>
Prefomatted
multi-line text
</pre></p>
which is invalid HTML.
Comments
Comment #1
st256 commentedTurns out this actually is a bug of php-markdown-extra, which has already been fixed in the recent version. When using the php-markdown-extra version 1.2.4, this behaviour does no longer occur. So to solve this, just replace the markdown.php file with the newer one.
Comment #2
justin2pin commentedFixed with http://drupal.org/cvs?commit=360882
Comment #4
steven jones commentedThis is still an issue in the D7 branch, patch attached to bring it up to the same version as the 6.x branch.
Comment #5
amalaer commentedsubscribing
Comment #6
langworthy commentedThe patch in #4 works for me in 7.0-beta1 (which is strangely 4 months newer than dev)
Comment #7
barraponto@langworthy: that's probably because the tag has been added later. There has been no commit since.
The patch works, but there's a new release from JAN/2012, we should better look forward to updating to that version.
Comment #8
barrapontoBut this patch can be skipped if we commit #1532380: Load Markdown library with Libraries API 2 instead.
Comment #9
Taxoman commentedAnother patch also available in #1366260: Markdown does not properly handle html5 block level elements