Preformatted text or code block does not work in nested list

OK, so this is a weird error I just encounted, not sure if I have reliable repro steps, but here I go:

So, I was trying to put code inside a nested list, and ran into all sorts of issues:
Typing this:

1. Foo
1. Bar
 1. Foobar
 1. Barfoo
```
some code
more code
```
 3. This should be 3!

Results in this:

  1. Foo
  2. Bar
  3. Foobar
  4. Barfoo
some code
more code
  1. This should be 3!

Adding a line above or below the code block doesn’t work, and indenting the code block breaks it.

1. Foo
1. Bar
 1. Foobar
 1. Barfoo
 ```
 some code
 more code
 this isn't a code block anymore...
 ```
 3. Now this is a 3!

Broken code block:

  1. Foo
  2. Bar
  3. Foobar
  4. Barfoo
some code
more code
this isn't a code block anymore...
  1. Now this is a 3!

If I try and use preformatted text instead, I managed to crash the tab. (I can’t put the text here as it will crash, but I will attempt to explain). If you copy all the text below this paragraph and paste it into the editor, it will freeze and the tab will have to be closed. The same will occur if you attempt to take the preformatted section below and indent it by an additional 4 spaces (which I believe will cause the last list item to be a 3 not a 1.

  1. Foo

  2. Bar

  3. Foobar

  4. Barfoo

    {
    “craftable_recipes” : {
    “building_parts” : {
    “ordinal” : 4,
    “name” : “Building Parts”,
    “recipes” : {
    “wood_doorway_recipe” : {
    “recipe” : “file(…/recipes/wood_doorway_recipe.json)”
    },
    “wood_double_doorway_recipe” : {
    “recipe” : “file(…/recipes/wood_double_doorway_recipe.json)”
    }
    }
    }
    }
    }

  5. This should be 3!

This is more markdown-it work. Try duplicating at http://commonmark.org FIRST any time stuff like this comes up, it’s not really a great use of our time to keep posting this. Try there first.

TL;DR we are switching to commonmark, but we can’t do it instantly.

2 Likes