Ordered lists shouldn't trigger for any number

If I’m correct, then the following syntax will trigger an ordered list: “5. Klasse in der Schule”. Just the bare fact that a new line starts with a digit followed by a dot and a blank starts an ordered list.

I’d like to propose to only trigger an ordered list if a) the line starts with a 1 (followed by dot and blank) or b) if the previous line is within an ordered list and the current line is an increment of the previous digit.

Two reasons for this:
First, who starts an ordered list that doesn’t start with 1? Making a list out of above example is just plain wrong.
Second; In many languages, such as German, Swedish, Bosnian, Dutch, Kazahk etc., it’s customary to use dots to denote ranks: 5. instead of 5th. This doesn’t imply a list.

2 Likes
  1. This is long established Markdown behavior. 10+ years. Every Markdown implementation treats:

    5. Klasse in der Schule
    

    as a list item. And since CommonMark’s places a high priority on backward compatibility, it is almost certainly not going to change the way you suggest.

  1. It’s a bit presumptuous to say it “is just plain wrong”, don’t you think? CommonMark’s design choices weren’t made willy-nilly or by unintelligent or uninformed people. There is certainly a justification for lists that start on numbers other than “1”. If you had taken the time to search this forum before posting, you would have found plenty of discussion on list behavior. I’m pretty sure the official spec explains this behavior as well. Also, HTML supports it, as the Babelmark results show.

(I don’t know if you’ve noticed, but I’m presenting an example of a list that continues across interrupting paragraphs. This would be impossible with your proposed behavior.)

  1. That said, you are right that Markdown has an English bias. But it’s impossible for a plain text format that’s designed to be human readable (i.e. not HTML) to work for all languages equally well.

    Maybe I will finish my side project that allows people to declaratively define Markdown extensions or even whole plain text formats from scratch. It’s called Plain Text Style Sheets. It would enable variations of formats (e.g. language/locale-specific) that could still work across an ecosystem of tools if it were adopted as a standard. Fingers crossed.

Thanks for your answer. My motivation to come here is a chat message I wrote, and it became a very ugly indented list element. That’s just plain wrong. Nothing to debate about this.

An ordered list never starts with a digit higher than 1 unless it’s the continuation of an ordered list. That’s actually what your example is about: It’s a correct ordered list that starts with 1 somewhere. No human starts an ordered list with item no. 9817 and then walks upwards.

  1. Also, the duration of a solution should have to say anything about it’s validity in my mind. But that measure we would still use Windows XP. Most importantly though, the languages that I mentioned (and some more) have been around for slightly longer than 10 years. And this affects round-about 200M native speakers.
1 Like

Then please show us what would be right. Design a plain text format that satisfies all the countless demands like yours that everyone makes (you’ve got 10 years of forum posts, plus plenty of online blogs to scour). Note that Markdown is used for far more demanding things than a mere “chat message”, from websites, to technical documentation, to doctoral theses. In fact probably the most commonly used lightweight markup tool used by researchers is Pandoc, created by @jgm, who not coincidentally is the author and maintainer of CommonMark. His decision to support lists that start from a number other than 1 wasn’t made lightly.

Or since there is no chance your proposal will be merged into Markdown/CommonMark for the backward compatibility reasons I already stated, and since your irritation has to do with whatever chat software you are using, propose your changes to the makers of that software (and its user community). Let us know how it is received.

Unless your chat software is only used by those 200M, your solution might need to please the nearly 2 billion native speakers of CJK languages, the over 1.5 billion native speakers of South Asian languages, and nearly 1.5 billion people of Africa whose numerous languages have yet their own conventions. And 300+ million native Slavic language speakers. I wonder what set of rules you’ll come up with that avoids a Chinese speaker coming in with criticisms like yours?

I look forward to your technical paper describing your solution and to see how you handle the countless drive-by absolutist criticisms you will get. Assuming you get any response at all.

(To the community: I know it’s foolish to respond to arrogance and ignorance in this way, but I have trouble ignoring people who walk into a complex problem out of the blue and declare that “it’s plain wrong” and “nothing to debate”. In the age of Trump, I’ve found it harder to just stay silent. My apologies for failure to remain silent. I need a :tumbler_glass:)

Are you actually so full of yourself to not understand the example? Making an ordered list out of “5. Juli”, “5. юл”, “5. julij”, “5. јул”, “5. heinykuudu” etc. when it’s the beginning of a line/paragraph is wrong. Can you actually counter that, or not? It’s neither arrogant nor ignorant to acknowledge that commonmark has a flaw here, but this seems this is beyond your horizon.

Here is how Slack defines it an ordered list (i.e., the trigger for an ordered list)

For a line to be an ordered list, it must satisfy one of two conditions:
condition 1: it starts with "1. "
condition 2: it starts with "\d. " and the previous line is an ordered list

Mattermost adheres to commonmark, for instance, but with hindsight they should not have adapted it fully (their words, not mine!)

There are four months that are named after gods.
The first three are named after Roman gods:

  1. January (after Janus).
  2. March (after Mars).
  3. June (after Juno).

The fourth is named after a Greek god:

  1. May (after Maia).

A general AI could tell when “4. May” is meant to mean “4th of May”
and when it is meant to be a list item. But if we required that
commonmark parsers be general AIs, how many would there be?

Fortunately, your problem is easily solved. You can just escape
the period in the rare event that you want to write a numeral
followed by a period right at the beginning of a paragraph.

4\. May is a date.

The escaped period will defeat interpretation as a list item.

1 Like

Interestingly, examples 304 and 305 demonstrate a type of behavior somewhat consistent with the desire of @Michael-E-Rose in the original post.

Thanks @jgm , this is very good to know! I pass this on to the Mattermost devs who forwarded me to here.

What people who haven’t spent significant time trying to design naturalistic plain text interpretation rules don’t realize is that it is essentially a game of Whac-A-Mole – you change a rule to fix the behavior for one use case you end up breaking the behavior for other use cases. Only AI (or a pseudo-AI decision tree with thousands up thousands of branches) would come close to solving that.

As I said, if you believe that Markdown, CommonMark, reStructuredText and AsciiDoc are wrong (they all interpret 5. Klasse in der Schule as a list item), then you should design and propose a new plain text format, not try to change a format that is committed to remaining backward compatible to a huge corpus of existing documents that rely on the existing behavior.

1 Like

Current behavior is definitely wrong, and has been for a long time, in all implementations. Being obviously wrong for a long time isn’t a good reason to continue being obviously wrong. It should support ordered lists that don’t start at 1, and should support skipping numbers in the middle.

Only a small workaround: Putting a narrow non-break space prevents the list and gives better typography. 5. Klasse