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?

  • It does a remarkably poor job on Perl. – tchrist Mar 28 '12 at 15:12

Stack Overflow uses Google Prettify for highlighting.

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

|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 'Callback Nov 20 '11 at 8:36
  • 1
    @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

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.

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

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.

|improve this answer|||||

You must log in to answer this question.

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