commonmark/commonmark-spec

Seemingly impossible to add empty lines before a list

Closed this issue · 3 comments

On the latest markdown dingus (https://spec.commonmark.org/dingus/), I cannot find an obvious way to add empty newlines before a list.

The following adds three empty newlines (that is, <br>s) before text:

\
\
\
text

(permalink)

However, when I try to turn the text into a list, it causes an extra backslash:

\
\
\
* text

(permalink)

The problem seems to be that the list starts a new paragraph. Furthermore, a row of backslashes in a standalone paragraph will leave the last backslash visible (this is probably intended; permalink). When combined, this means that a list will always have a backslash before it, even if the author does not add an empty newline between the backslashes and the list. The problem happens for ordered and unordered lists, and also for titles.

This is intended.

Why would you want this?

If you do have some esoteric need to do this, here is an esoteric solution:

<br>
<br>
<br>
* text

A design principle for a simple, human friendly syntax is to not complicate normal usage to support the odd, rare or unrecommended.1

Footnotes

  1. depending on the intent of those blank lines, the recommended solution might be to use a thematic break (e.g. * * *), CSS, the <br>s, or something else.

@wooorm The second part of your answer comes off as dismissive, though maybe it's not meant to be -- it's hard to tell over text. Thank you for mentioning that this is intended behavior, though. I played around a bit, and the interaction simply appears to be that the list always starts a new paragraph and that a backslash at the end of a line before a new paragraph is not removed. I discovered that it also happens with other formatting contexts like opening a quote, so that makes sense.