At the moment, we have these choices when providing error messages / logs:
This preserves the formatting of the error message, though it uses spurious highlighting and disables line-wrapping (both the latter are seldom appropriate)
Use code-blocks with
<!-- language: none -->
Same as #1, but at least no inappropriate highlighting.
Same as #2, but html works and thus must be escaped.
Markdown and HTML work and must be escaped, no fixed-width font and whitespace-collapsing, but at least line-wrapping works
Insert as normal text
None of the advantages of either previous option and all the drawbacks, though still popular with new users who do not know better or cannot be bothered.
None of those is really good for logs/errors which easily get just too wide.
What I propose is introducing an alternative, which is especially appropriate for logs and error-messages:
Add something like
<!-- language: log --> which makes code-blocks use no highlighting and word-wrap their lines to avoid horizontal scrolling.
This SO question shows which style would have to be applied to code-blocks marked as log: How do I wrap text in a pre tag?