The Problem
The issue here was that the syntax highlighting was identifying the code block as Markdown and using the highlighting for that language. This happened because:
- The bash language tag was removed from the question in an edit (see revision 3), which caused
lang-sh
to not be the only potential syntax highlighting language passed to highlight.js. - The syntax highlighting language for awk was set to
default
, which, when there isn't a specific language defined in other question tags, results in feeding the default list of languages to highlight.js as possible highlighting languages. This allows highlight.js to try to find the "best" language among those in the default list. [Note: that the default list is not used when there's a language defined on another tag is an assumption on my part, but that assumption is consistent with how it appears to be operating. I have not looked in SE's code to verify this is actually what's happening.]
Since the default list was being used, highlight.js did the best it could at guessing which language to use from among those in that list and the short amount of code. In this instance, highlight.js ended up deciding that Markdown was the "best", so used syntax highlighting for that language.
Resolution
I have changed the syntax highlighting language for the awk tag to <none>
and rolled back the edit which removed the bash tag from that question.