6

Now that have code highlighting enabled, we need to determine how 'automatic' it should be.

The code highlighting engine works in two ways:

  1. Automatic inference of the language in use via the tags on the question, and
  2. Manual specification of the language in a code block, overriding any language behavior on a question tag

Currently, we have highlighting enabled for a large number of tags, a default set from Stack Overflow or some such. We've already disabled automatic highlighting on a small handful (, , ) due to awkward highlighting on questions, but we need to decide what approach to take for a consistent behavior across all tags.

4
  • 2
    Whichever route we go we should try to find somewhere more prominent than the m.SO post for explaining how to turn on (or OFF) the highlighting...
    – voretaq7 Mod
    Commented Feb 9, 2012 at 2:31
  • It's there, just buried at the bottom of the page: serverfault.com/editing-help#syntax-highlighting (fixed the link in the answer) Commented Feb 9, 2012 at 2:35
  • I was more referring to the list-o-languages, though this is pretty obscure too :)
    – voretaq7 Mod
    Commented Feb 9, 2012 at 3:17
  • 1
    Please, only use the up votes. Commented Feb 9, 2012 at 7:06

3 Answers 3

16

Enable it extremely selectively on tags where the content of a code block has a high chance of actually being code.

For instance, enable these:

But, leave most everything else disabled.

  • Our questions should be more configuration and errors than SQL syntax; lang-sql would be more detrimental then helpful.
  • Our questions are rarely code, and rarely even stack traces; lang-py would be more detrimental than helpful.
  • Our questions are rarely code, lang-php would be more detrimental than helpful.
  • ...etc...
1
6

Disable all automatic highlighting, globally, across all tags.

You won't see a lot of highlighting at all, since it needs to be manually specified by the author (it's explained in editing help, but to really do it right takes a dig in m.SO) - but at least there won't be any highlighting of something that isn't code.

0

Enable it on all tags for which there's a language available, even if we get some false-positive highlighting.

The increased incidence of highlighting on actual code is worth it, and/or the coloring is subtle enough that it doesn't bother me.

2
  • FTFY​​​​​​​​​​​​​​​​​​​​
    – Mark Henderson Mod
    Commented Feb 9, 2012 at 2:27
  • @MarkHenderson Thanks :) Commented Feb 9, 2012 at 2:30

You must log in to answer this question.

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