On Stack Overflow, code can have syntax highlighting.

I’d like to have this feature here on Webmasters, too.

Especially the codes:

  • lang-html
  • lang-css
  • lang-js
  • lang-xml

(And lang-none, if auto-detection via tags should work here, too.)

  • TBH I didn't realise this wasn't already available on this site! It could be useful for perhaps HTML and XML, however, most other code related questions that involve JS and CSS are generally off-topic. – MrWhite Mar 29 '14 at 16:09
  • This makes sense, looking into it. – Tim Post Apr 3 '14 at 12:12

This is done, however - there's no default style. You'll need to specify as you use it. We've also enabled this on the Unix related sites, Super User, etc - where questions sometimes have a smidgen of code that has to be shown.

Active both on the main site and on meta (for questions about formatting). Note, code related questions are off-topic, but sometimes questions (and answers) need a bit for context, so I've enabled it.

There are enough limitations with pre-formatted blocks alone that several have asked for this, and there's no harm in enabling it with no default, so I went ahead.


You must log in to answer this question.

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