Paragraph tags around <div> blocks

Sherwood Botsford sgbotsford at gmail.com
Sat Mar 7 01:01:59 EST 2009


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.

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

--
Sherwood Botsford
Sherwood's Forests
Warburg, Alberta T0C 2T0
http://www.sherwoods-forests.com
780-848-2548


More information about the Markdown-Discuss mailing list