Correct way to align code block inside a list item

I think I have same issue, I’m looking for a way to get code blocks in list and it just doesn’t seem to work at all.

Single line codes are fine

image

But code block just breaks things

image

Seems like I’d have to remove the list and insert the code block but that’s not a solution, because it’s not indented

image

Example of how I would expect it to work

This seems like very basic functionality, so I guess I just don’t know how to make this work.