Related to Code-Coloring for Inline-Code in Answers

It would be nice to be able to use the automatic syntax highlighting on a block of code, and at the same time manually insert markup for specific sections.

For example if a question contains a block of code one may wish to repeat the same block in an answer but with markup such as <strong> to highlight the changed portions.

However this is not possible at present because normal markup is ignored in code blocks.

I suggest a new tag such as {{{ ... }}} or <codeblock> ... </codeblock> to trigger the usual syntax highlighting but without disabling normal markup.

Or is there a workaround for the current implementation?

1 Answer 1


I suspect this would end up being complicated in both implementation and use, but I can certainly see the point.

Another alternative might be to have special line endings which you could then use to refer to particular lines easily later. That might be easier to achieve - so // [1] might be translated into a bold "1" which you could then label afterwards.

Admittedly this is entirely based on the Manning book style which I'm familiar with :) I suspect it could work quite nicely on SO though... it depends how easy it is to modify Prettify.

  • Prettify is a huge pile of ____. Jul 20, 2009 at 15:49
  • Care to clarify, Brad? Hard to modify? Ugly? ??
    – Shog9
    Jul 20, 2009 at 16:40

You must log in to answer this question.