Sign up ×
Web Applications Stack Exchange is a question and answer site for power users of web applications. It's 100% free, no registration required.

In Markdown, you should be able to specify a block of code that will not trim whitespace by using four spaces in front of every line of code. Why doesn't it work?

share|improve this question

2 Answers 2

Code blocks can be placed in comments too. Surround the block with three backticks.

# All your bases are belong to us.

If you'd like to pre-format just a word or function name, surround it with one backtick.

share|improve this answer
That helped! +1 –  Anwar Aug 29 at 5:41
Some comments on formatting from the source: –  slothbear Aug 30 at 0:56

It does work, you are mostly likely placing a block after a list. Consider separating it with a header

    int main()
^ Four spaces

Will turn into this in your card

int main()
share|improve this answer
A blank line will also do the trick. –  Rich Armstrong Jan 31 '12 at 13:20

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.