Markdown handling of whitespace in lists

AI 生成的摘要

The discussion revolves around Markdown handling of whitespace in lists on Discourse. jmsachs is having trouble creating a blank line inside a numbered list element without restarting the numbering. jmsachs notes that Stackoverflow Markdown allows this, but Discourse does not. tobiaseigen suggests using <br> as a workaround, which jmsachs finds helpful. david mentions that Discourse will be switching to CommonMark, which handles lists similarly to Stackoverflow Markdown, in the next version. codinghorror adds that mixing loose and tight lists in Markdown is not possible.

Discourse Markdown seems to be quite a bit different than Stackoverflow Markdown and I’m wondering how to format some text properly when it’s in an extended numbered list. Is there any way to create a blank line inside a numbered list element, so that the numbering doesn’t restart?

In Stackoverflow, this markup text:

1. Hickory dickory dock,
   the mouse ran up the clock
   the clock struck one

   the mouse ran down,
   hickory dickory dock.

2. Mary had a little lamb 
   whose fleece was white as snow.

   And everywhere that Mary went the lamb was sure to go.

produces this:



but in Discourse it looks like this:


  1. Hickory dickory dock,
    the mouse ran up the clock
    the clock struck one

    the mouse ran down,
    hickory dickory dock.

  2. Mary had a little lamb
    whose fleece was white as snow.

    And everywhere that Mary went the lamb was sure to go.


odd, I thought Discourse used CommonMark, which seems to match the StackOverflow behavior.

Probably unsatisfying, but you can get what you want with <br>, like this:

  1. Hickory dickory dock,
    the mouse ran up the clock
    the clock struck one

    the mouse ran down,
    hickory dickory dock.

  2. Mary had a little lamb
    whose fleece was white as snow.

    And everywhere that Mary went the lamb was sure to go.

Produced with this:

1. Hickory dickory dock,
the mouse ran up the clock
the clock struck one
<br>the mouse ran down,
hickory dickory dock.

2. Mary had a little lamb 
whose fleece was white as snow.
<br> And everywhere that Mary went the lamb was sure to go.

ah – ok, thanks, that’s a good workaround for me.

Not yet, it’s coming in the next version though :smiley:

You can’t mix loose and tight lists in Markdown.