Paragraph tags around <div> blocks

Milian Wolff mail at milianw.de
Sat Mar 7 06:29:42 EST 2009


On Saturday 07 March 2009, Sherwood Botsford wrote:

> It's a monolog week for me. Answering my own post. Again.

>

> Turns out it's not that simple. Consider the following input fragment:

> (For clarity, I'm compressing the double spacing. All <div> tags have

> a blank line before and after.

>

> # Headline outside div

> <div>

> # Headline inside div

> </div>

>

> Run through MMD I get:

> <h1 id="headlineoutsidediv">Headline outside div</h1>

> <div>

> # Headline inside div

> </div>

>

> IF I use DIV instead of div

> <h1 id="headlineoutsidediv">Headline outside div</h1>

>

> <p><DIV></p>

>

> <h1 id="headlineinsidediv">Headline inside div</h1>

>

> <p></DIV></p>

>

> Which causes the w3c validator the whine.

> I get this form of result if I have <div id=foobar>

> but the first form of result if I have <div id="foobar">

>

>

> This behaviour is identical for both MMD 1.0.24 (CPAN) and for MMD

> 2.0.b5 (FP's website)

>

> I think that the regex that's scaning for a div tag is looking only

> for a well formed one.

> Being either wrong case or with a malformed id it's treated as text,

> and surrounded by <p> tags.


That's a bug.


> If the divs match the expression it doesn't process the content.


That's how it should be. Markdown does not alter / change stuff inside HTML
tags (think <code> or similar). At least PHP Markdown Extra supports a
proprietary `markdown="1"` attribute for tags which should get their contents
markdowned.

--
Milian Wolff
mail at milianw.de
http://milianw.de
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 197 bytes
Desc: This is a digitally signed message part.
Url : <http://six.pairlist.net/pipermail/markdown-discuss/attachments/20090307/ba6bfcd3/attachment.pgp>


More information about the Markdown-Discuss mailing list