13

I created a README.md file on GitHub and there are some markdown problems I can't find a solution to.

When I enter this (The dots represent space signs):

Instructions:..
....1. First sentence..
....2. Second sentence..

........This is some code.

....3. Third sentence..
....4. Fourth sentence

It renders to this:

Instructions:
1. First sentence
2. Second sentence

 This is some code.
3. Third sentence
4. Fourth sentence

How can I separate the code block from the numbered list?

I would also like to know how I can tell Markdown to ignore Markdown syntax so I don't have to use dots as a representation of space signs.

asked Sep 26, 2013 at 19:45
2

1 Answer 1

16

How about this?

Instructions:
1. First sentence
2. Second sentence
 `This is some code.`
3. Third sentence
4. Fourth sentence

It wouldn't indent each point, however your example with the dots doesn't do it either. If the spacing between Instructions: and the rest is not what you want, you can use the double space after it and on the two following lines.

UPDATE: After a little fiddling, if you want to keep the numbering of the list and put some code that's relative to a single item on the list you should indent the code block. Also, have a new line before the first element of the list seems to help.

answered Sep 26, 2013 at 20:15
Sign up to request clarification or add additional context in comments.

3 Comments

Using this github-preview.herokuapp.com, it seems to work. You can add extra ` around the code block and remove the 4 spaces actually.
Oh right, sorry. That's because you're indenting the whole block so it's interpreted as a code block.
But I have to indent it. Otherwise numbers 3 and 4 will break and show 1, 2 instead.

Your Answer

Draft saved
Draft discarded

Sign up or log in

Sign up using Google
Sign up using Email and Password

Post as a guest

Required, but never shown

Post as a guest

Required, but never shown

By clicking "Post Your Answer", you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.