The highlighting in code blocks is done by a Python library called Pygments
. If no language is specified in the code
tag, Pygments tries to guess which language it is. Sometimes it guesses incorrectly, which is what's happening in that post.
You can always just specify the language by name like so:
You can specify any language from Pygments' list
The auto-guessing behavior is what the site has had since the beginning, so we kept it when we rolled out the new BBCode parser about four months ago. I know sites like Github don't auto-guess languages in their code blocks, so maybe someday we could turn that feature off.