What is the necessity of "Code Sample" button in the "Markdown Editor" of this site?

2 Answers 2


Even if the term "Code Sample" is not exactly "right" for this domain (English Language and Usage), it allows for the <pre> tag:

<pre> tag defines preformatted text.

Text in a pre element is displayed in a fixed-width font (usually Courier), and it preserves both spaces and line breaks.

It can be useful, for instance, when you are quoting poems which may use special indentations, using several spaces. In the simple HTML this editor allows, "several spaces" are not easily done.
Except in preformatted text.

  • So change the name "Code Sample" and the icon. Aug 8, 2010 at 7:36
  • 1
    @chanchal1987: I agree, but that maybe a request to repeat back in the central Meta (MSO: MetaStackoverflow) in a more general manner (i.e. non-"English language and usage" specific)
    – VonC
    Aug 8, 2010 at 9:53

It can be used when showing an example of a markup. Like this:

It was a dark and stormy knight(1). All the beagles were asleeep(2).

(1) = "night", not "knight" (2) = "asleep", not "asleeep"

This should probably be community wiki if others have other uses in mind as well.

You must log in to answer this question.

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