locked for the history - please post bugs and feature-requests separately.
We're changing the way syntax highlighting is done on the Stack Exchange engine.
As you probably know, we use Google Code Prettify for automatic syntax highlighting.
Since the beginning, we've had kind of a boolean setting per website:
- code blocks are always automatically highlighted (Stack Overflow, programmers.se, etc)
- code blocks are never highlighted (Super User, photo.se, bicycles.se, etc)
We are now moving to a more tag-based syntax highlighting method. There are one of three possible syntax highlighting hints associated with each tag:
- specific language hint -- tell prettify to use that language
- default language hint -- let prettify infer a language
- null -- no hint, no syntax highlighting
(all specific languages must be in the set that prettify supports, obviously)
bsh, c, cc, cpp, cs, csh, cyc, cv, htm, html, java, js, m, mxml, perl, pl, pm, py, rb, sh, xhtml, xml, xsl.
apollo, css, go, hs, lisp, lua, ml, proto, scala, sql, vb, vhdl, wiki, yaml
If a question has no tags with a default or specific language hint, no syntax highlighting will be performed.
If a question has at most one tag with a specific language hint, plus any number of default or null hints, then syntax highlighting will be performed only for that specific language.
If a question has two tags that both define specific languages, it uses default and lets prettify infer as it always has.
As long as a question has one or more tags with default language hints, but none with a specific language hint, it uses default and let prettify infer as it always has.
The default tag syntax highlighting hint is null. So the question is, which tags should have the default and specific language hints? I put my initial pass through the first 6 pages of tags here:
If you feel there should be changes, post your diffs as answers.
(and yes, there are plans to allow an explicit override syntax but for now we want to try to get the defaults mostly correct before worrying about the edge conditions)