Possible Duplicate:
Allow highlighting certain bits of a code fragment or quote

Sometimes when I respond to a question that contains a block of code, and my answer includes the same block with minor (and sometimes not obvious) changes, I would like to highlight the lines of code that are different to make them stand out. For example, in a different shade background, or maybe a bold font -- some way for it to visibly stand out from the rest of the code.

Is this possible, or has this been considered before?

  • From what I remember of previous discussion, the consensus was that if you need to do this, you're posting too much code; although this doesn't apply to the particular case you're talking about, of highlighting differences – AakashM Nov 3 '11 at 16:53
  • 1
    Cool, thanks for those references. Yeah, I think it may make more sense for answers, since we're updating someone's original code, and trying to point out the changes that are needed. Just including the changed code and trying to explain it could get confusing, IMO. Commenting the code was something I thought about, but to me, this seems like it would be much cleaner and easier for the original poster to see the solution. – Jerad Rose Nov 3 '11 at 16:57
  • I would post the original code in one block, then a separate block with the changes. – JNK Nov 3 '11 at 20:44