Obviously, there not being a way to specify the end of a list, and multiple line breaks making list item contents paragraphs, the only way to have adjacent lists is to alternate between ordered and unordered lists.

1. ordered list item

- unordered list item

The above text outputs:

<ol><li><p>ordered list item</p></li><li><p>unordered list item</p></li></ol>

This seems like a bug to me. I tested in the "canonical" PHP version and it does distinguish the lists. It seems that Showdown is more greedy than expected when looking ahead for subsequent list item markers. This is how it's rendered off the server:

  1. ordered list item

    • unordered list item

Edit: egads, the server version has a completely other bug (rendering the second list as a child of the first).

  • you're wasting your time here -- per the babelmark link I provided below, the perl version is canonical, not the PHP version. And they disagree over interpretation. Like I said. Feb 21, 2010 at 8:32
  • @Jeff Atwood, I don't think asking for clarification is a waste of my time. It's a shame I had to give up 100 "reputation" to do so, but so be it. I disagree with your reasoning. I don't think the actual (as opposed to my scare-quote reference to the PHP implementation) canonical implementation necessarily trumps the letter of the specification, which is not in the least ambiguous (which you cited in your response, which is why I asked repeatedly for clarification). But getting you to clarify was certainly not a waste of my time. Feb 21, 2010 at 9:07
  • Why did you "have" to give up 100 rep?
    – AnonJr
    Feb 21, 2010 at 16:39
  • @AnonJr, if you look at Jeff's answer and my comments, you can see that he was not responding until I added a bounty. Feb 21, 2010 at 18:28
  • 1
    @eyelid I am saying the same thing I said pre-bounty, below. You just aren't willing to hear what I'm saying -- that the spec itself is ambiguous. Please click here (same as below) goo.gl/TWFQ I guess we can keep doing this until one of us gets tired or bored, but babelmark doesn't lie -- and it says the spec is ambiguous. Your opinion, however wonderful it may be, does NOT trump babelmark. Sorry. Feb 22, 2010 at 9:14
  • @Jeff, I asked you to provide evidence of ambiguity on this behavior from the spec, which you ignored. Providing an example of differences in implementations doesn't necessarily mean the spec is ambiguous, the implementations (even the canonical*) might have bugs. Babelmark isn't the spec, is it? Can you understand why I don't accept Babelmark as the final word? I'm not stating my opinion, I'm stating my interpretation of the spec, as in the one written by Gruber specifying Markdown's behavior. * You've said yourself that the original implementation had plenty of bugs. Feb 22, 2010 at 16:40
  • @Jeff, I just want to add that I am only asking at this point, since you invoked the spec (and now repeated this invocation), for you to show where the spec is ambiguous on this. Feb 22, 2010 at 16:41
  • @Jeff, It fascinates me that you are willing to address anything except the spec, and hold that this is "by design". Why won't you address the spec? Or are you claiming that babelmark is the spec? Feb 24, 2010 at 17:43

2 Answers 2

  1. First list
  2. Second Item
  • Second List
  • Fourth Item
  1. Hello World
  2. Jonathan Sampson

HTML comments seem to eliminate the problem. It would be nice if a couple returns distinguished one from another, but unfortunately that isn't the case. For now <!-- foo --> seems to break them up.


I don't think Markdown really supports what you want. Refer to babelmark

If you must have two lists on top of each other (still an odd use case) I suggest doing this:

1. ordered list item

<!-- list separator -->

- unordered list item

which produces:

  1. ordered list item
  • unordered list item
  • 3
    I agree it's an odd use-case. In fact, I only found it by accident. I do think the behavior is a bug though. In the case of the first list swallowing the second, it is disregarding the second list's type marker, which isn't exactly unclear in the original Markdown documentation. Where the second list is becoming a child of the first, there is no indentation to indicate that it should. Having a quick fix is nice, but I do think it's a bug. Feb 9, 2010 at 0:26
  • @eyelid not a bug, the spec itself is ambiguous -- see babelmark. Feb 9, 2010 at 3:25
  • 1
    I saw your link. I could find no such ambiguity on the meaning of the list item markers in the spec, just in the implementations. Can you show me where it's ambiguous in the spec? Feb 9, 2010 at 4:18
  • 1
    I really would like to see where it's ambiguous on this. I don't believe this is by-design. I'd understand if you simply said it's a bug you won't fix. Feb 13, 2010 at 21:00
  • @eyelid repeated myself for the benefit of your bounty. I urge you to click on the babelmark link and study the results. Feb 22, 2010 at 9:17

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .