5

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?

1
  • 2
    It does a remarkably poor job on Perl.
    – tchrist
    Commented Mar 28, 2012 at 15:12

3 Answers 3

14

Stack Overflow used Google Prettify for highlighting at the time of the question (although in 2020 Stack Exchange switched from Google Prettify to highlight.js)

2
  • 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? Commented Nov 20, 2011 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. Commented Apr 6, 2012 at 6:48
17

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.

1
  • 1
    I meant remarkably well considering it probably doesn't know what language it is. Commented Aug 15, 2009 at 14:30
4

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.

You must log in to answer this question.

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