The discussion revolves around improving numbered list functionality in Discourse’s markdown parser. Users highlight issues such as the inability to start lists from numbers other than one, skip numbers, or use the same number for multiple items. A key concern is the automatic conversion of ordinal numbers (e.g., “3rd”) into list items, which disrupts content in non-English languages. Examples show how lists with non-sequential numbers or interruptions (like URLs or bullet points) are mishandled. While HTML <ol start=4> can work, it’s not ideal. The community discusses potential solutions, including using pre blocks or modifying the parser. Sam notes that the current behavior aligns with the markdown spec, but Discourse plans to upgrade to a newer markdown-it parser later in the year, which may resolve these issues. probus, sam, codinghorror, mattengi, Mark_Elder, and codinghorror contribute to the conversation, with sam confirming the fix is pending a parser upgrade.
We’re struggling a bit with the parser and automatic formatting of posts. In particular, numbered lists. There are a couple of ways in which they drive our posters mad:
You can’t start a list from any other number than one, or have the
list count down
You can’t skip numbers or have the same number for
items
If you start a paragraph with a number, it get’s interpreted as a list even if it doesn’t have any other numbered items below it. This might not be a big problem when writing in English, but in my language that’s how you write ordinal numbers (1st, 2nd etc). Imagine starting your sentence with “3rd time it happened..” and the forum changing it into “1st time it happened..”
As an example Gibson.com Top 50 Guitarists of All Time – 50 to 41
49. (tie) Ritchie Blackmore (Deep Purple, Rainbow)
49. (tie) Kurt Cobain (Nirvana)
47. (tie) Robert Fripp (King Crimson)
47. (tie) Andrés Segovia
42. (tie) Hubert Sumlin (Howlin’ Wolf, Muddy Waters)
42. (tie) Clarence White (The Kentucky Colonels, The Byrds)
42. (tie) Rory Gallagher (Taste, solo)
42. (tie) John Frusciante (Red Hot Chili Peppers)
42. (tie) Richard Thompson
41. David Gilmour (Pink Floyd)
turns out like this:
(tie) Ritchie Blackmore (Deep Purple, Rainbow)
(tie) Kurt Cobain (Nirvana)
(tie) Robert Fripp (King Crimson)
(tie) Andrés Segovia
(tie) Hubert Sumlin (Howlin’ Wolf, Muddy Waters)
(tie) Clarence White (The Kentucky Colonels, The Byrds)
(tie) Rory Gallagher (Taste, solo)
(tie) John Frusciante (Red Hot Chili Peppers)
(tie) Richard Thompson
David Gilmour (Pink Floyd)
Of course, one can use pre formatted text (as we do now), but it’s not ideal or intuitive. Is there any way to improve or configure this behaviour?
It is a clear diversion and violation of the markdown spec.
We would be open to adding this functionality (optional - default off) to our markdown parser if contributed via the community. Would probably have to be upstreamed.
The <ol> tag does not support arbitrarily numbered lists, so if you were to allow “any order” we would have to construct a special div.
Our markdown parser is actually quite flexible, its possibly it could be hacked to support “floating” numbers but it would mean your forum would work differently to all other Discourse forums out there.
I agree that list support is not markdowns shining moment, and the spec has not moved in like forever.
Not “fixed” because it works that way in the spec. The behavior listed above is 100% correct per the official spec. We literally had to fork the project and create a new official spec. Takes time.