Skip to main content
3 of 4
added 336 characters in body
gertvdijk
  • 69k
  • 21
  • 28

Fixed it for you. And no, this is not a bug, but how Markdown works.

The key thing is to indent one level further and use a 4-space indent, so make it 8 spaces to indent. See also the Markdown syntax:

To put a code block within a list item, the code block needs to be indented twice — 8 spaces or two tabs:

    *   A list item with a code block:

            <code goes here>

More tips:

  • No need to use incrementing numbers. Use 1. for every list item.
  • Also no need for <code> or <pre> blocks - we don't have that in Markdown as far as I know.

So, an example:


1. item text.

   some text below the item but under the same item.

1. next item increments numbers automatically.

1. Here's some code:

        Code block line 1
        Code block line 2

1. And here's item 4.

Renders to


  1. item text.

    some text below the item but under the same item.

  2. next item increments numbers automatically.

  3. Here's some code:

     Code block line 1
     Code block line 2
    
  4. And here's item 4.

gertvdijk
  • 69k
  • 21
  • 28