Code block is not properly formatted when placed immediately after a list item
I was just submitting a new answer to an old question on Stackoverflow and noticed my code block was not being formatted as code.
It was originally positioned between a bulleted list and some plain text.
I discovered that when I cut and paste it to after the plain text it would be formatted correctly, but pasting it back in its old positions would always be without format. Adding blank lines around it made no difference.
Here's a screenshot of the same code block in both positions showing the first unformatted and the second correctly formatted:
Let's see what happens here:
var foo = 'bar'; // works
var bar = 'foo'; // doesn't work