-2

Code samples are largely irrelevant on EL&U (not to mention they starkly contrast with the style/theme of the site), but the specific formatting they provide is not useless. There are two primary reasons they are useful. The first is that code sample styling allows for uniform spacing (every character takes the same amount of screen space, so things can be laid out nicely). The second...well consider the following:

(both of these are generated using the exact text from this question)

  1. I waited for my friend on the restaurant for two hours, from 10 AM to 12PM. But he never arrived. A) For B) On C) To D) No error

41. I waited for my friend on the restaurant for two hours, from 10 AM to 12PM. But he never arrived. A) For B) On C) To D) No error

Here on Meta, they are both gray. However, the code section still looks broken and ill-formatted. Note, though, that the code section accurately displays the number as "41", whereas the blockquote section displays it as "1".

On the main site, blockquotes mesh well with the color scheme, while code samples stick out badly and look just plain ugly. Can we get the style changed for code so that (despite the fact that EL&U doesn't discuss code) it doesn't look horrific on our site?

4

41. This is how you can make the 41 show properly.

41\. This is how I did it, by escaping the period following the number with a backslash.

Using code markup to offset something that isn't code isn't a great idea for searchability and other reasons. Instead, in situations such as this, just properly escape whatever you need to and it will appear as intended in your quoted text.

You must log in to answer this question.

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