Meta Stack Exchange is where users like you discuss bugs, features, and support issues that affect the software powering all 158 Stack Exchange communities.

What is meta?
Here's how it works:
  1. Any Stack Exchange user can ask a question
  2. The community provides support, votes on ideas, and reports bugs
  3. Your voice helps shape the way Stack Exchange operates

In this question the OP included a snippet of expected output (the order of some values in a hashmap).

I thought this would be best formatted as a plain single-spaced list with no numbering, bullets (like the HTML <pre> tag I guess). The closest I found is the code formatter. Is there a standard accepted way to format "expected output" sections?

share|improve this question
Format as for code is best. – nb69307 Jun 4 '10 at 12:14
up vote 2 down vote accepted

In most situations, you want to use code formatting. If you are expecting a certain output, you probably have a specific nature as what the lines should be outputted, so using code formatting lets you keep everything that should be on one line in one line. This is superior to block quotes, which will wrap if it is too long. Any additional formatting should match how the output should be.

The only real downside to code formatting your expected output/input is that when it isn't code, you can get some wonky coloration. This actually looks pretty good in some cases, but if you find that the resulting coloration for a particular output is very distracting or makes the text seem unreadable, then you can opt to use block quotes instead.

share|improve this answer

If you use <pre> tags, it will give you code-block like look without the highlighting, but also without the automatic escaping of special characters like < and >. You would have to escape those characters by hand where appropriate, but that's error prone and tedious.

Since you usually want the special characters escaped, code formatting is the easier and safer choice.

share|improve this answer

You must log in to answer this question.

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