0

Possible Duplicate:
Changes to syntax highlighting

Over at ServerFault we are having a community discussion about wether or not we should enable code highlighting.

However we can't seem to find the answer to a question we have:

When code highlighting is enabled on the site, does it always try to highlight code-blocks, even when no 'languages' are tied to tags? Does it do nothing unless you manually override it?

You can follow our discussion here.

This is important for us because we don't want it to try and detect some random error-dump and go all crazy on colors. The only way we would use this is by using the manual override, as described here by Jeff.

3
  • @MichaelMrozek Doesn't tell wether or not it is possible to only enable the manual-part and not the automatic. Jan 23, 2012 at 23:57
  • It sure seems like it does. Each tag can have specific and default language hints -- if none of the tags have either, only the manual override is going to do anything Jan 24, 2012 at 0:00
  • @TiZon Highlighting can be enabled for the site and not specified automatically for any tag. Still, even on code-heavy sites it's pretty rare that syntax highlighting does something horrifically bad that can't be fixed on a case-by-case basis.
    – Adam Lear StaffMod
    Jan 24, 2012 at 0:01

1 Answer 1

2

It doesn't look like it's enabled on Server Fault at all, but for the sake of completeness...

Syntax highlighting first has to be enabled on the site and then it can be configured on a per-tag basis.

If your question has a tag that'd trigger syntax highlighting in code blocks, you can use <-- language: lang-none --> to turn it off before a particular code block that you don't want the highlighting to apply to.

3
  • I've got that link to the list of lang-foo markups on a quickmark, because the tag-hinting gets it right only most of the time. :)
    – sarnold
    Jan 23, 2012 at 23:38
  • OK, that is what we figured out. What happens if a post with a code block has no tags that are tied to a language? Will it try to auto-determine it? (standard behavior of prettify) Jan 23, 2012 at 23:55
  • @TiZon No highlighting will be applied. Come to think of it, the duplicate Michael Mrozek found does cover this in better detail than I could. :)
    – Adam Lear StaffMod
    Jan 23, 2012 at 23:59

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