# Enable default syntax highlighting

Since most questions on this site won't be language specific, but virtually all answers will contain code, the tag-based syntax-highlighting approach recently adopted by SO won't work for this site. However I think that syntax highlighting would be worthwhile to have nonetheless.

I thus propose that the old mode of syntax highlighting be enabled for this site, where all the code samples are highlighted using prettify's default "guess" mode.

• Jan 30 '11 at 16:33

I agree. Perhaps we could turn on syntax highlighting with no hints only when the tag is used. I have always preferred to be specific by using this tag over letting users assume it's implied by the lack of a language tag.

• I'm not fond of having a tag that applies to almost every question. Though that's a different discussion. Jan 30 '11 at 16:34
• @sepp2k It might be the case now, but we've only been going on 2 days. It's one of the many things time will tell. Jan 30 '11 at 16:39

Given that SO's syntax highlighter is notoriously bad for plenty of source code I'd rather prefer no syntax highlighting to broken one.

If there was a way to hint a specific language to use that might be an option. But prettify's own detection is (imho) worse than no highlighting at all. And »Supports all C-like, Bash-like, and XML-like languages« was definitely not enough on SO; it may well be not enough here.

• They are using Google's prettify now, aren't they? If so there is a way to hint. Added: Looks like it's not done yet. See meta.stackexchange.com/q/72082/2509 and linked. Jan 30 '11 at 20:41

I'd like syntax highlighting. Here's my idea:

We could use:

<meta language="C++" />

Here's some code:

#include <iostream>

int main()
{
std::cout << "Skynet imported for the 42nd time.";
return(0);
}

As you can see, it pretty much sucks.


Or something similar to distinguish between languages. It reverts to guessing if <meta language="C++" /> isn't specified.

• @S.Mark That doesn't seem to work... Apr 29 '11 at 5:49
• sorry, its only works on Stack Overflow and meta, I don't know why. ref - meta.stackexchange.com/questions/981/…
– YOU
Apr 29 '11 at 5:58