Code blocks not working correctly?

I did, but you said you were trying to use both techniques to achieve a result that is best achieved using <pre> tags. (per my examples)

If you want to show someone how to use code blocks, use pre tags. Don’t try and embed code fences inside indents or indents inside code fences.

As for why the no highlight using indent, that may be a legit bug, but likely within highlight.js. I’m not sure why it isn’t figuring it out.