Non-spaced indented entirely automatically numbered lists do not render, and spaced lists do not render correct subsequent line spacing

https://github.com/markdown-it/markdown-it/issues/939#issue-1750584686

Summarily, nested non-spaced automatically numbered (0.) lists don’t render more than one level deep without indentation, whereas manually numbered lists do, and spaced lists do not render correctly.

More specifically, per https://github.com/microsoft/vscode/issues/184429#issue-1744161712:

[@mjbvz](https://github.com/mjbvz),

Commonmark also won’t render this correctly at all without a new line before the nested list: [commonmark demo](https://spec.commonmark.org/dingus/?text=0.%09test%0A0.%09test%0A%090.%09test%0A%090.%09test)

It wouldn’t make sense that

0.	Placeholder
	1.	Placeholder
	2.	Placeholder
	3.	Placeholder
	4.	Placeholder
0.	Placeholder
	1.	Placeholder
0.	Placeholder

is rendered correctly then, when

0.	Placeholder
	0.	Placeholder
	0.	Placeholder
	0.	Placeholder
	0.	Placeholder
0.	Placeholder
	0.	Placeholder
0.	Placeholder

is not:


However, the spaced indented lists don’t render correctly either:

0.	**Manually numbered indented section**

	0.	**Non-separated**

		0.	Placeholder
			1.	Placeholder
			2.	Placeholder
			3.	Placeholder
			4.	Placeholder
		0.	Placeholder
			1.	Placeholder
		0.	Placeholder

	0.	**Separated**

		0.	Placeholder

			1.	Placeholder
			2.	Placeholder
			3.	Placeholder
			4.	Placeholder

		0.	Placeholder

			1.	Placeholder

		0.	Placeholder

0.	**Manually numbered indented section**

	0.	**Non-separated**

		0.	Placeholder
			0.	Placeholder
			0.	Placeholder
			0.	Placeholder
			0.	Placeholder
		0.	Placeholder
			0.	Placeholder
		0.	Placeholder

	0.	**Separated**

		0.	Placeholder

			0.	Placeholder
			0.	Placeholder
			0.	Placeholder
			0.	Placeholder

		0.	Placeholder

			0.	Placeholder

		0.	Placeholder

is rendered as


The [codified](links) are because I’m a new user.

1 Like

As pointed out on GitHub, this is intended behavior, which has very good reasons. If CommonMark changes its behavior to work as you use it, it would break for the far more common way it is used.

Also, there is an easy solution for your usage. For autonumbered lists, use all 1s rather than 0s:

1. Placeholder
   1. Placeholder
   1. Placeholder
   1. Placeholder
   1. Placeholder
1. Placeholder
   1. Placeholder
1. Placeholder
1 Like

@vas, how could I suggest a modification to the specification to accommodate this? It surprises me that Markdown provides support for hard-wrapped line breaks of all things, and values that support more highly than consistency.