Given the new syntax highlighting language hint system, a post tagged and should cause the syntax highlighter to switch to the default detect language based on code block content mode.

However, the code blocks in this question shows otherwise - even though two language tags are specified, the code blocks still receive HTML's highlighting rule. A quick check at the source shows this to be true:

HTML containing the lang-html class used by the syntax highlighter

So am I reading the new rules incorrectly, or is this a bug?

1 Answer 1


So am I reading the new rules incorrectly, or is this a bug?

It's not a bug, but the rules can change.

The reason this happens is because has a language assigned to it: HTML. is set to default, that is, prettify inference. Languages take precedence, so the final output is deemed to be HTML.

Do you think that should also be set to default?

  • 1
    I assume the reason why [javascript] is assigned default is because it's a front-end web dev language, so posts tagged [javascript] would usually also contain HTML or CSS snippets. (In your original post the rule states javascript -> lang-js) If that is indeed the case, then I would prefer [javascript] to be assigned a specific language, since any posts tagged with any of the other front end web dev language is equally likely to contain snippets in other languages which are not directly relevant to the question
    – Yi Jiang
    Jan 23, 2011 at 9:03

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .