Discourse Markdown does not see lists without a proceeding blank line


(Peter N Lewis) #1

If you type:

This is a list:
* one
* two

You get this non-list result:

This is a list:

  • one
  • two

For some reason Markdown on Discourse requires a blank line before the list, like this:

This is really a list:

* one
* two

Which gives this:

This is really a list:

  • one
  • two

I checked on CommonMark, and confirmed its “Try” behaves correctly. Reading the spec is unclear (surprise, surprise - a spec that doesn’t actually answer the case you’re looking at, like every other spec in existence). Section 4.8 says “A sequence of non-blank lines that cannot be interpreted as other kinds of blocks forms a paragraph”, and clearly those lines can be interpreted as a list block, so presumably that is definitive enough, as is 4.9 which says “Blank lines between block-level elements are ignored, except for the role they play in determining whether a list is tight or loose.”

In any event, if the CommonMark spec for the above (without a line break) does not define it to be a list, then its pretty silly IMNVHO, and this catches me out regularly when posting, especially as the Preview look and the rendered look, and the email results are all very different (and get worse which is bad).


(Jeff Atwood) #2

This is debatable. See the topic about it at commonmark. 19 out of 23 implementations count it as a para not a list.

Anyway the spec is not final, do not open “bugs” on beta products here, whether browsers or otherwise.


(Jeff Atwood) #3