5

I was browsing a Stack Overflow question and in an answer there is an ordered list, but it was written using ) instead of . so I tried to edit it.

When in click edit the list was rendered correctly as ordered list without any change, but in the original post it's not rendered as ordered list.

Screen Grab

1
  • 1
    Since the CommonMark migration in 2020, parentheses-style lists were allowed in addition to dot-style lists; and posts need to be re-rendered in order for Markdown to be parsed and displayed as HTML. The CommonMark migration script didn’t migrate posts where the re-rendered post looked differently from the original and it wasn’t easy to fix automatically. This post wasn’t edited since 2013. See this answer on “We're switching to CommonMark”. Mar 31, 2021 at 7:44

1 Answer 1

3

In the old days the only valid markdown to create a numbered list was:

1.
2.
3.

or

1.
1.
1.

In June of 2020 the Stack Exchange network migrated to CommonMark, of which the Stack Overflow founder Jeff Atwood is one of the contributors.

The CommonMark spec defines an ordered list as:

a sequence of 1–9 arabic digits (0-9), followed by either a . character or a ) character.

According to that, the way the post you cite was written is CommonMark compliant. Seeing that it was last edited in 2013 however means that it hasn't be re-rendered using the new CommonMark renderer. The vast majority of posts was re-rendered when the migration took place using migration scripts.

From the migration announcement:

With the auto-fixing utility we estimate that we’re going to land at over 96% of all network posts being rendered completely identical after migrating to CommonMark and using the new renderers. This leaves us with a few percents of posts that end up looking differently when rendered with the new CommonMark renderers.

We avoid breaking existing posts by erring on the side of safety. If a post looks different using the new renderer (and if it’s just one whitespace off) we won’t automatically re-render the post

As re-rendering this post resulted in different HTML (a numbered list where there previously was no list) it was left in its old state. (SE stores rendered versions of a post, rather then the markdown version).

Now trying to edit this post it will get rendered with the new renderer, according to the CommonMark spec, and will thus include a numbered list.

This was also pointed out in an answer to the original migration announcement, with comments from developer Ham Vocke♦ explaining things.

You must log in to answer this question.

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