Note: You can click this edit link to see the source code of this answer (if you have enough rep).
To create space-honouring text in Markdown you have a number of options.... There are recommended ways, and other supported ways.
You can have <pre>this has 6 spaces</pre>
(supported, but not recommended) forces a new paragraph (even if the <pre>...</pre>
is embedded within the text sentence/paragraph), and looks like:
this has 6 spaces
even when embedded.
Alternatively (recommended), if you want to include the formatted text in a paragraph, you can use the 'backtick' quote (`) (found to the left of the 1 key on US-keyboards) embedded in a paragraph.
Using <code>This is code</code>
(supported, not recommended) also works and does not force a paragraph either, even .... when used in a paragraph
like that. When you use the backtick it works even with spaces in the text
and it can be embedded in a paragraph.
If you want a block of formatted text (Recommended) and even for the text to be syntax highlighted, and processed using markdown, you can indent blocks of text with 4 spaces...
public static final void main(String[] args) {
// This is a formatted comment:
// i. using spaces to show
// that spaces are honoured...
System.out.println("Hello World!");
}
The full help for Markdown is here: Editing Help, and it includes links for more details too. The sections are 'collapsed', so click the show more
link in each section for... more.