I love Stackoverflow ;) . However, when something not language specific is asked or when you want to answer with just a pseudo code I find code highlighting not very useful.

It would be great to see something like in Tex: where you can define things like:

\ForEach{Element in Array}{
    Do my thing with Element
     Do other thing while condition is true

And those will be highlighted/formatted very elegantly.

What I am suggesting is to have a way to tell Stackoverflow: Don't automatically highlight my code. I want to highlight this and this word only.

I know that having a tex-like parser is too much to ask but I also believe something can be done to make pseudocode look nicer in Stackoverflow (See how Do, true, etc words were highlighted above?)

Thanks ;)

FYI: This is an example of what TEX does very easily:

alt text

  • 4
    Some people might take issue with your juxtaposition of 'TEX' and 'easily'. Not me, of course :) – Benjol Jan 17 '11 at 10:10
  • Slightly related: Interface options for specifying language prettify proposes a way to explicitly set one of the known languages that Google Code Prettify supports. – Arjan Jan 17 '11 at 10:37
  • Also related: Allow highlighting certain bits of a code fragment or quote. – Arjan Jan 17 '11 at 10:42
  • 1
    For people who are interested in easy Pseudo Code Highlight in Tex, see algorithms.berlios.de/index.html – colinfang May 14 '11 at 20:12
  • I'm mostly taking issue with the "elegantly": I've always hated that textbook-style pseudo code. I find it incredibly hard to read, for some reason. I think the typographic noisiness of it is to blame mostly. I'd much prefer unhighlighted plain text for pseudo code. And never mind the syntactic details, I'm sure that not too many people will have trouble figuring out whether that's assignment or comparison. – Kerrek SB Jan 24 '13 at 0:50

From the formatting FAQ, you can insert an HTML comment before your code block to tell Google Prettify to perform syntax highlighting according to a specified language, or no language at all:

To specify that you don't want any syntax highlighting for a code block, use

<!-- language: lang-none -->

You must log in to answer this question.

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