Note that this question is a bit obsolete, because we now infer prettify language type based on the tags.
See more:
Changes to syntax highlighting
This is now implemented. In addition to tag inference, you can manually specify the language as a hint to Google Code Prettify.
The spec is:
<!-- language: lang-or-tag-here -->
code goes here
<!-- language: lang-or-tag-here -->
code goes here
You may use either a tag or a prettify language code to specify, though prettify language codes are always guaranteed to work regardless of what language the tag happens to be set to.
Use <!-- language-all: lang-or-tag -->
to use the given highlighting for all the following code blocks.
practical examples
For those with little time...
<!-- language: lang-js -->
<!-- language: typescript -->
<!-- language: c# -->
Please note they're all in lower case, even though the language may be uppercase (C#) or mixed case (TypeScript).
Suppress any syntax highlighting (prevents poor, misleading guesses)
<!-- language: lang-none -->
Use language-all
and your syntax highlighting choice shall be used for all code blocks that follow:
<!-- language-all: lang-html -->
Available Language Hints Moved
Due to several lists of available hints existing throughout Meta, the entire list has been consolidated and moved to the following FAQ:
What is syntax highlighting and how does it work?
'\'
makes the rest of the code act as though it is inside a string.<!-- language: lang-php -->
or<!-- language: lang-javascript -->
or<!-- language: lang-none -->
...etc. (also, here's the language list.)