Skip to content

Instantly share code, notes, and snippets.

@chrissearle
Last active December 20, 2015 17:08
Show Gist options
  • Save chrissearle/6166045 to your computer and use it in GitHub Desktop.
Save chrissearle/6166045 to your computer and use it in GitHub Desktop.
* List item 1
* List item 2
code line 1
code line 2
code line 3
* List item 3
  • List item 1

  • List item 2

      code line 1
          code line 2
          code line 3
    
  • List item 3

  • List item 1

  • List item 2

      code line 1
      code line 2
      code line 3
    
  • List item 3

@gettalong
Copy link

This behavior is intentional. The amount of indentation used for list items is determined by the first non-whitespace character on the list item starting line.

This means that the content of the list item has an indentation of 2, not 4. Therefore the code block needs to be indented 6 spaces, not 8 spaces.

All this is documented in the syntax documentation and this is one part in which kramdown differs from the original Markdown. The reason for this is to get something that works easy and in an unsurprising way. You don't really want to know how the original Markdown handles differently indented list items and especially nested list items...

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment