Note: Since Stack Overflow's migration to Highlight.JS, the default is based on Highlight's automatic language discovery and best-effort highlighting.
This answer is no longer applicable, but left here for historical purposes.
To answer this question you have to dig a bit through Google Code Prettify which I did for you.
The method langHandlerForExtension selects which registered prettifier is going to be used:
function langHandlerForExtension(extension, source) {
if (!(extension && langHandlerRegistry.hasOwnProperty(extension))) {
// Treat it as markup if the first non whitespace character is a < and
// the last non-whitespace character is a >.
extension = /^\s*</.test(source)
? 'default-markup'
: 'default-code';
}
return langHandlerRegistry[extension];
}
It selects a langHandler based on what is after a lang-
from the registered handlers. If it can't find one it will choose the handler for markup if your code block starts with a <
and ends with a >
. If that is not the case it uses the default-code
handler.
The mentioned handler is registered with this line registerLangHandler(decorateSource, ['default-code']);
.
Looking up how decorateSource
is defined you'll find:
var decorateSource = sourceDecorator({
'keywords': ALL_KEYWORDS,
'hashComments': true,
'cStyleComments': true,
'multiLineStrings': true,
'regexLiterals': true
});
So it assume both hashComments as well as cStyleComments and takes in ALL_KEYWORDS.
var ALL_KEYWORDS = [
CPP_KEYWORDS, CSHARP_KEYWORDS, JAVA_KEYWORDS, JSCRIPT_KEYWORDS,
PERL_KEYWORDS, PYTHON_KEYWORDS, RUBY_KEYWORDS, SH_KEYWORDS];
and if you think this means that in the default prettifier every keyword in all major programming language is taken into account, you're right.
tl;dr There really is not a single language that is used as the default highlighter, it simply smashes together the keywords for major languages and handles two of the most common commenting styles and then tries to make the best of it.
As mentioned in What is syntax highlighting and how does it work? the default for highlighting is lang-none
. Which mean that prettify leaves the code untouched. So you only see the default being used if either explicit declared in the markup or configured on the tag. For example css uses lang-default
because ... reasons ...