Meta Stack Exchange is where users like you discuss bugs, features, and support issues that affect the software powering all 158 Stack Exchange communities.

What is meta?
Here's how it works:
  1. Any Stack Exchange user can ask a question
  2. The community provides support, votes on ideas, and reports bugs
  3. Your voice helps shape the way Stack Exchange operates

Possible Duplicate:
Code blocks after a list, but not within a list in markdown. Is it possible?

First, this is not the same as discussed here because the use case is slightly different, I don't want the code to be shown as an item in the list.

  1. Anyway, this is the bug I just noticed.
  2. As expected, the list works as it should.

    But having a code block here with multiple lines, I might add doesn't behave as expected.

    I know about the 8 spaces for indentation
    but this is not what I want to have.
  3. But, if I add a single character right after the list wrapped with newlines before and after

  4. (As an example I'm using a comma here)


The code = Block("appears", "just") as expected;
#with ($colors && $everything)
  1. Also note that the numbering of the list keeps going from one to four while I'd expect it to go 1,2 - 1,2 - 1.
  2. In conclusion, seems like code block indented with four spaces isn't considered as a list terminator.
share|improve this question

marked as duplicate by Jeff Atwood Apr 11 '10 at 22:32

This question has been asked before and already has an answer. If those answers do not fully address your question, please ask a new question.

See Code block after numbered list: Markdown bug? (which seems to have been closed for the wrong reason) and Code blocks after a list, but not within a list in markdown. Is it possible? – Arjan Apr 11 '10 at 8:46
See also Code block is not properly formatted when placed immediately after a list item. (This is the oldest duplicate I could find.) – Hendrik Vogt Jul 24 '11 at 9:34
  1. Because 4 spaces
    is used to span list over

    paragraphs and lines.

    1. And the list runs from
      1 to 4 since that is how

      a standard <li> works.

  2. These are all described

    in the editing help and
    Markdown reference.

You can cheat with a
pair of <b></b> tags, but it
is an ugly hack.
share|improve this answer
That's unfortunate, because it's not what I want. I think that adding two linefeeds to end the list before the code block should work to get around this. – Esko Apr 11 '10 at 8:41

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