[Possible Bug]: Additional <p> wrapper around HTML input

Michel Fortin michel.fortin at michelf.com
Sun Sep 2 10:44:11 EDT 2007

Le 2007-09-02 à 8:56, Milian Wolff a écrit :

> <hr id="foo" />

> <hr id="foo">

> <hr id="foo"/>

Well, it's a documented limitation on the Markdown syntax page: "The
only restrictions are that block-level HTML elements -- e.g. `<div>`,
`<table>`, `<pre>`, `<p>`, etc. -- must be separated from surrounding
content by blank lines, and the start and end tags of the block
should not be indented with tabs or spaces."

"hr" is a block-level element, but you have not separated them by a
blank line.

This is a "designed" limitation to simplify the parser. It doesn't
mean a parser shouldn't do better, and I believe John is trying to
improve Markdown.pl to remove some limitations like this one.

> Interesting is, that Markdown Extra handles this correctly.

Indeed, Markdown Extra's HTML block parser is much better at that
than PHP Markdown's or the one in Markdown.pl.

Michel Fortin
michel.fortin at michelf.com

More information about the Markdown-Discuss mailing list