-5

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

  • 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
  • 1
    its not bug ,its because of list – NullPoiиteя Jan 27 '13 at 4:07
4
  • 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
| improve this answer | |
  • Thanks :) But isn't point 2 a workaround ? It still is a bug. – asheeshr Jan 27 '13 at 7:32
  • 4
    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 .