I believe there are reasons like easier readability and preserving the original formatting that would make enabling some way of creating multiline code blocks in comments preferable.

Searching through the meta, it seems the rendering is done differently in answers and comments, so this may not be easy/possible, but I believe this would be desirable. I would consider this inconsistency a bug, since it breaks user expectation.

  • 5
    I don't think would typically be considered a bug on a Stack Exchange meta and suggest removing the tag. It's pretty clear that this is what the developers intended, regardless of the reasons or your agreement with them.
    – doncherry
    Jan 3 '13 at 7:59

Jeff Atwood wrote:

multiple lines are not supported in comments, and will never be

Comments are treated as a single line, so multi-line code is impossible. I guess one reason is rendering speed.

  • MathJax is enabled in math.SX's comments and I think rendering multi-line code should run faster than MathJax. Jan 3 '13 at 0:30
  • 9
    Even more importantly: Comments shouldn't become too extensive, i.e. paragraph breaks typically aren't encouraged.
    – doncherry
    Jan 3 '13 at 8:00
  • 1
    @doncherry that doesn't handle the case of code though - 3 simple lines of code should be on 3 lines. Is there a convention I'm missing here, to inform the reader of a comment that a line break is required at a certain point?
    – Chris H
    Aug 9 '13 at 12:18

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .