I've seen too many newbies hit the "quote" button instead of the "code" button while posting. This is much worse than if they just left the code inline, because the quote button rewraps all the text and saves the post with mangled code.
For example, here's some (bad) C++:
class X{};
X& foo() {
X x;
return x;
}
int main() {
X &x = foo();
}
and some quote-mangled C++:
> class X{};
>
> X& foo() { X x; return x; } int main() { X &x = foo(); }
Once they've saved the post, it is impossible to recover the original formatted code without a substantial amount of effort. One user used it on a stack trace about 100 lines long producing an unreadable mess, not realizing that "quote" was the wrong function for a nicely-formatted stacktrace.
I understand the holdover from email, but it seems unnecessary for StackOverflow to rewrap given that quoted text renders essentially identically to unquoted text (aside from being enclosed in a <blockquote>
). It seems to me it would be easier to have the quote button just prefix >
to each selected line, kind of like how the code button prefixes
, and leave it at that.
So the question is: why does the quote button have to rewrap text when you push the button?
For reference, here's how quoted text appears, first using the quote button and second by manually prefixing >
:
class X{};
X& foo() { X x; return x; } int main() { X &x = foo(); }
and
class X{};
X& foo() { X x; return x; } int main() { X &x = foo(); }
The appearance is identical, but the latter quote can actually be reversed into proper code later on.