Would like the ability to apply a highlighter (background yellow, red, etc..) to identify a specific section of code to draw attention to it. Note that this would be inside of the formatted code itself.
What is meta?
- Any Stack Exchange user can ask a question
- The community provides support, votes on ideas, and reports bugs
- Your voice helps shape the way Stack Exchange operates
http://pastebin.com does this in a very neat way!
"To highlight particular lines, prefix each line with @@" I see it as a proper inspiration.
Pastebin is also open source: http://pastebin.com/pastebin.tar.gz So it is easy to see how the implementation works.
Post minimal code fragments that have been abstracted down to just what it takes to exhibit the problem?
Then all the code is necessary, and highlighting is not.
I know that this is not always possible, but it is possible much more often than people use it.
That would require changes to the code used to do syntax-coloring right now, which isn't managed by SO. It would be a nice feature though. Perhaps for now your best bet is to show the code without its context, and with its context. It's a bit more verbose than what you're proposing, but it's the best way I can think to achieve this right now.
What's wrong with this:
Tell it to google-code-prettify; that's what SO uses. Of course, you can always just do something like: