What is meta? ×
Meta Stack Exchange is where users like you discuss bugs, features, and support issues that affect the software powering all 127 Stack Exchange communities.

I posted a citation in an answer to a question, reproduced here:

H. Muhammad and R. Ierusalimschy. C APIs in extension
and extensible languages. Journal of Universal Computer
Science, 13(6):839–853, 2007.

Stack Overflow highlighted it remarkably well. What language does it think this is? Does it detect a citation?

share|improve this question
It does a remarkably poor job on Perl. –  tchrist Mar 28 '12 at 15:12
add comment

3 Answers

up vote 12 down vote accepted

Stack Overflow uses Google Prettify for highlighting.

What you're seeing highlighted is Google's doing, not Stack Overflow's.

share|improve this answer
StackOverflow handles Delphi formatting correctly and automatically, as it seems. Prettify can't detect Delphi (I've made custom rules for it) automatically and does so only if the language is explicitly specified. I am wondering if SO team made changes to Prettiry or developed its own ruleset for Pascal / Delphi code? –  Eugene Mayevski 'EldoS Corp Nov 20 '11 at 8:36
@EugeneMayevski'EldoSCorp StackOverflow now determines which language to use by the tags associated with the question see: meta.stackexchange.com/questions/72082/… . There are also provisions to override the language used. –  Brad Gilbert Apr 6 '12 at 6:48
add comment

I can hardly consider that a remarkably good highlighting for a citation. I don't think SO detects citations. It just thinks it's code and sees "Title case" words, lowercase words, etc. It has a list of keywords (look at the blue and in the snippet) and uses some heuristics to highlight stuff.

share|improve this answer
I meant remarkably well considering it probably doesn't know what language it is. –  Paul Biggar Aug 15 '09 at 14:30
add comment

Not sure what language it's going with, but the highlighting isn't very magical. There are four classes of appearance visible:

  1. Capitalized words (light blue)
  2. Likely reserved words (dark blue)
  3. Numbers (dark red)
  4. Everything else (black)

Nothing amazing, and yeah, I'd say it's debatable that it's really great highlighting for a citation.

share|improve this answer
add comment

You must log in to answer this question.

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