[kramdown-users] Paragraph in list items

Shawn Van Ittersum svicalifornia at gmail.com
Mon Mar 15 06:33:18 EDT 2010

That's seems a bit too magical and unintuitive to me... though I don't know what else to suggest.

If you do implement it, be sure to check if the last item's contents are already wrapped in a block of some kind.  We wouldn't want a div getting wrapped in a p.

* <div class="highlight">Lorem ipsum ...</div>

Zooming out a bit, why do we need paragraphs in list items?  I can see the use case for this:

* First item

  New paragragh in first item

  Another new paragraph in first item

* Second item

But in that case, only the "new paragraphs" need to be wrapped in p tags.  Margin can be added to the list items via CSS or inline attributes.

I'll admit that requiring CSS to add margin when the current behavior already adds margin simply via p tags seems, well, a bit ridiculous.  But to assume that the last item should be a p tag just because the others are seems like a path to unintended consequences.


On Mon, 15 Mar 2010 08:01:54 +0100, Thomas Leitner wrote:
> Hi everybody,
> the current behaviour for whether a list item is wrapped in a paragraph
> or not depends on the list item being followed by a blank line. As
> pointed out in the syntax document, this can easily be done for all but
> the last list item. The last list item needs an EOB marker placed so
> that it is converted to a paragraph.
> I'd like to change this behaviour so that the last list item is *also*
> converted to a paragraph if *all* other list items are wrapped in
> paragraphs. This would create correct output for lists such as:
>     * Some para
>       here
>     * Some para
>       here
>     * Some para
>       here
> Normally, the last paragraph would just be text and not wrapped into a
> paragraph. With the new rule, it would also be converted to a paragraph
> as expected.
> What do you think?
> Best regards,
>   Thomas
> _______________________________________________
> kramdown-users mailing list
> kramdown-users at rubyforge.org
> http://rubyforge.org/mailman/listinfo/kramdown-users

More information about the kramdown-users mailing list