div & span support

John Fraser showdown at attacklab.net
Mon Mar 5 12:25:21 EST 2007


A. Pagaltzis <pagaltzis at gmx.de> wrote:

> I'm not sure I follow. Markdown doesn't wrap block elements in

> paragraph tags. What is it that you want to change?


Markdown tries to avoid wrapping paragraphs around things they're not
allowed to contain, but it misses the mark often enough to be
dangerous:

Like when you <div>don't skip lines</div> around HTML blocks.

or

<p>...when you omit close tags.

or

<div>
<div>
...when the parser gets confused (try this one in Showdown or
Markdown 1.0.2b2).
</div>
</div>

Those cases could be handled with a couple of fixes to the
text::balanced HTML parser (and a brand new parser for Showdown).

I'm guessing the other cases of extra paragraphs are mostly things like this:

<div>
<div>
This is just one line, so I don't want it wrapped.
<div>
This is just one line following a block element, so I don't want
it wrapped.
</div>

...which can be handled by saying "don't make solitary paragraphs" and
"count block elements as paragraph breaks."

I'm sure there are other examples that generate unwanted paragraphs,
so I'd like to get a list of all of them and see if we can't find a
way to make this work across the board.

-John


On 3/5/07, A. Pagaltzis <pagaltzis at gmx.de> wrote:

> Hi John,

>

> * John Fraser <showdown at attacklab.net> [2007-03-05 15:35]:

> > On 3/5/07, A. Pagaltzis <pagaltzis at gmx.de> wrote:

> > > I've come to appreciate the fact that it means you can pump

> > > the output of Markdown back through Markdown without it

> > > getting reprocessed, which happens because Markdown wraps

> > > everything in `<p>` that isn't already wrapped.

> >

> > I may be wrong about this, but I'm betting we can tweak the

> > paragraph rules so that they don't add unwanted `<p>` inside

> > HTML. Never wrapping block elements in `<p>` tags would be a

> > good start.

>

> I'm not sure I follow. Markdown doesn't wrap block elements in

> paragraph tags. What is it that you want to change?

>

> Regards,

> --

> Aristotle Pagaltzis // <http://plasmasturm.org/>

> _______________________________________________

> Markdown-Discuss mailing list

> Markdown-Discuss at six.pairlist.net

> http://six.pairlist.net/mailman/listinfo/markdown-discuss

>



More information about the Markdown-Discuss mailing list