Can I use a single space for list indent with Goldmark

I’m upgrading a site from 0.40.x to 0.71.x, and have been making changes to support the Markdown engine change.

All my source files are “badly formed” Markdown with only a single space for indentation:

* First
 * Second

Under BlackFriday, it rendered:

  • First
    • Second

Under Goldmark, it renders:

  • First
  • Second

I understand that you might have called this “a bug” in BlackFriday. From what I read, CommonMark seems to need at least two spaces for an indent.

Is there a way to ask it to use the old behavior - at least for the first indent? Or should I just change all my source files?

The number of spaces required for a sublist depends on spacing of its parent list. See:

https://spec.commonmark.org/0.29/#example-264
https://spec.commonmark.org/0.29/#example-265
https://spec.commonmark.org/0.29/#example-266
https://spec.commonmark.org/0.29/#example-267

It if were me, even if there were a workaround, I would change my source files.

3 Likes