What is meta? ×

Possible Duplicate:
How to nest code within a list using Markdown
Markdown formatting bug with code blocks in lists

In this answer the first line of code in the question is being displayed properly. The background of the other code sections are different from the background of the first code block.

enter image description here

share|improve this question

marked as duplicate by Bo Persson, balpha Jan 27 '13 at 8:57


I've seen this problem when you try to post code in a list or just after a list (as you're doing). –  Hovercraft Full Of Eels Jan 27 '13 at 3:30
its not bug ,its because of list –  NullPoiиteя Jan 27 '13 at 4:07

1 Answer 1

  • Inside a list context, you need to indent code by eight spaces

    foo += bar

    and start subsequent lines with a space to keep them indented.

  • If you want to have a code block right after your bullet point indented as if it wasn't in the bullet list, use a comment <!-- -->.

foo -= bar
share|improve this answer
Thanks :) But isn't point 2 a workaround ? It still is a bug. –  AsheeshR Jan 27 '13 at 7:32
I don't think it is. Since lines starting with one space are considered to be inside the list/bullet item. The four-space indent isn't enough for a code block inside the list, but it also is enough for the paragraph to be considered inside the list. You can't break that without something that's not indented at all, the parser can't tell the difference. –  Mat Jan 27 '13 at 7:36

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