[Bug] PHP Markdown (Extra) generates invalid HTML for code blocks

Milian Wolff mail at milianw.de
Sun Sep 2 12:32:11 EDT 2007


Am Sonntag, 2. September 2007 schrieb Michel Fortin:

> Le 2007-09-02 à 10:23, Milian Wolff a écrit :

> > PHP Markdown v 1.0.1i and PHP Markdown Extra v 1.1.5 generate

> > invalid HTML for

> > code blocks

> >

> > Take this input:

> >

> > paragraph

> >

> > codeblock

> >

> > Markdown will generate:

> >

> > <p>paragraph</p>

> >

> > <pre><code>codeblock

> > </pre></code>

> >

> > Notice the wrong position of the closing code tag.

>

> Oh my! That's a typing error, and it did not fail the testsuite!

>

> I said previously that the HTML normalizer in MDTest wasn't quite

> optimal (although better than Tidy) and that's why: it doesn't catch

> this kind of misnested tags. Otherwise I'd have got failed tests

> everywhere. Perhaps it's time MDTest uses its own stricter HTML

> parser instead of the too forgiving parser in PHP 5.

>

> I'll fix that promptly, thanks for that report.


May I ask which parser you use? I wrote my own for the rewrite of
html2text.php. I just applied it as a sourceforge project, if you are
interested you might have a look into it the next week.


--
Milian Wolff
http://milianw.de


More information about the Markdown-Discuss mailing list