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.

CommentFileSizeAuthor
#4 markdown-684554.patch15.57 KBsteven jones

Comments

st256’s picture

Turns 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.

justin2pin’s picture

Status: Active » Fixed

Status: Fixed » Closed (fixed)

Automatically closed -- issue fixed for 2 weeks with no activity.

steven jones’s picture

Version: 6.x-1.x-dev » 7.x-1.x-dev
Status: Closed (fixed) » Needs review
StatusFileSize
new15.57 KB

This is still an issue in the D7 branch, patch attached to bring it up to the same version as the 6.x branch.

amalaer’s picture

subscribing

langworthy’s picture

Version: 7.x-1.x-dev » 7.x-1.0-beta1

The patch in #4 works for me in 7.0-beta1 (which is strangely 4 months newer than dev)

barraponto’s picture

@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.

barraponto’s picture

But this patch can be skipped if we commit #1532380: Load Markdown library with Libraries API 2 instead.

Taxoman’s picture

Status: Needs review » Closed (duplicate)