What is the necessity of "Code Sample" button in the "Markdown Editor" of this site?
2 Answers
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.
-
-
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)– VonCAug 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.