seemingly no good way to end bulleted list and start code block

Michel Fortin michel.fortin at
Sat Oct 6 22:41:48 EDT 2007

Le 2007-10-06 à 19:37, Matt Kraai a écrit :

> Howdy,


> The following bug report was sent to the Debian BTS. Is there a way

> to have a code block immediately follow an unordered list?

As Aristotle pointed out, there's a workaround: use an HTML comment,
like that:

* bla
* bla

<!-- comment -->

this is a code block.

It's not optimal, but the only solution currently.

Note that creating a second paragraph in the list item is correct
behaviour, not a bug. That you can't write a code block immediately
following a list is unfortunate, but since it would be done using the
exact same characters as for adding a paragraph to a list item, it's
a design issue we can't really solve without changing some part of
the syntax.

- - -

This issue has been raised many times, and I've been personally biten
by it too. I also noticed that with PHP Markdown Extra, many new
features (footnotes, definition lists) behave like list items and
can't be immediately followed by an indented code block.

So I'm seriously thinking about adding a second (unindented) code
block syntax to PHP Markdown Extra that would avoid this issue
entirely. Something like this:

Regular paragraph

Code block

Of course, unless John adopts it for Markdown, it'll only benefit
users of PHP Markdown Extra.

Michel Fortin
michel.fortin at

More information about the Markdown-Discuss mailing list