Quoting code as code?


I noticed this post where quoted code loses formatting. I made a few attempts on try.discourse.org to get quoted code right, but failed.

Is there a good way to quote code?


Either this:

    code code code code

(indented by four spaces)
or this:

code code code code

(surrounded with triple back ticks)
With the second syntax, you can put a syntax highlighting language after the first set of back ticks, like this:

var foo = bar();


Do you mean that you have to select the code, click on quote reply and then manually indent the code?

It would be nice to have Discourse do that for me.


Quotes do not support any kind of formatting at the moment other than plain text. Why not just mention a @name and then put in code instead?


Fine with me, but I would have never thought of that. Either it is just me, or it should be mentioned somewhere.