but, I did some tests here, the only way to make code blocks and lists work together in the current version 0.56.3 is:
On the first level in a list, the first code block in the the topic shall use 8 spaces:
* Some Content
content
The subsequent levels, the first code block in the topic only needs 8 spaces + (4 spaces * preview level):
* First level
code
* Second level
code
The first code block in a list topic shall not use the triple Grave Accent syntax. It Shall use only spaces. The subsequent code block in the same level, without a content in between shall use use grave accent syntax:
* First level
code
```c
code
```
The thing is, when using code highlight and different programming languages, how to achieve using spaces indentation?
What are you trying to do in that Markdown snippet? Do you want the code block to be simply in that first bullet? In that case, why is there an * before ```?
As an aside, I use - instead of * for lists. So I’m not sure if Blackfriday is buggy when using * as plain list markers.
the problem with - is that, if your file start with a list, and your list use - symbol, hugo will throw an error invalid YAML delimiter, because is expecting a front-matter.
Regarding your original question, this Markdown renders to this HTML, with the list item and code block placements as expected, using the latest Hugo 0.57-DEV (built post 0.56.3 release).
I setup the version Hugo Static Site Generator v0.57.0-DEV linux/amd64 BuildDate: unknown to test locally. Your example worked fine. I pushed some more combinations and was able to break the thing
In the second level, 4 spaces before - and 4 spaces before code 2 and before the 3 grave accent, this does not break the parser loop, and the title is processed and stay in the right indentation, but on 0.57.0-DEV, the behavior is different, it break the hole thing, the parser goes wild, and everything after that is messed up.
To make it to work fine in 0.57.0-DEV, in the level 2 you have to add 8 spaces before code 2 and before the 3 grave accent, for 0.55.4, 4 or 8 spaces does not matter for the first code block in the second level:
The thing is, I don’t know if there was some kind of safeguard on 0.55.4, where the intention was that the hole thing does not break, and was removed on 0.57.0-DEV, or finally the expected behavior is working…
Hmm, I have always kept the beginnning ``` and ending ``` at the same indentation level, so never had this issue. Your question might be for the BlackFriday team… though, does it make sense to have the beginning and ending ``` at different indentations?