Bug found in Markdown?

I seem to have found a bug in Markdown (the syntax and conversion tool for web writing). In a nutshell, it looks as though paragraph spacing in lists causes a side effect in which two adjacent lists will be “merged” together. I was trying to use something like this:

- First unordered item
- Second unordered item
- Third unordered item

1. First ordered item
2. Second ordered item
3. Third ordered item

Unfortunately, when converted to HTML, this becomes one big list:

  • First unordered item
  • Second unordered item
  • Third unordered item
  • First ordered item
  • Second ordered item
  • Third ordered item

Workaround

Inserting some text between the paragraphs seems to be the easiest way around this:

- First unordered item
- Second unordered item
- Third unordered item

Breaker breaker one nine

1. First ordered item
2. Second ordered item
3. Third ordered item

Here’s the HTML:

  • First unordered item
  • Second unordered item
  • Third unordered item

Breaker breaker one nine

  1. First ordered item
  2. Second ordered item
  3. Third ordered item

Theory

This seems to be a side effect of the syntax feature that allows paragraph spacing in lists. Here’s a quick example:

List without spacing:

*   Bird
*   Magic

HTML:

  • Bird
  • Magic

List with spacing:

*   Bird

*   Magic

HTML:

  • Bird
  • Magic

That example, taken from the John Gruber’s online documentation, makes perfect sense. Here’s that example again, tweaked a bit to show the issue:

List with spacing:

*   Alex Rodriguez

*   Derek Jeter

*   CC Sabathia (note the double-spacing)



*   J.D. Drew

*   David Ortiz

*   Mike Lowell

HTML:

  • Alex Rodriguez
  • Derek Jeter
  • CC Sabathia (note the double-spacing)
  • J.D. Drew
  • David Ortiz
  • Mike Lowell

For obvious reasons, the last three entries have no business being associated with the first three. You can download this post in Markdown format to experiment on your own. Can anyone think of a clean way around this?

Advertisements

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s