# Preformatted text or code block does not work in nested list

**URL:** <https://meta.discourse.org/t/preformatted-text-or-code-block-does-not-work-in-nested-list/39166>\
**Category:** Bug\
**Tags:** markdown-it-review\
**Created:** [2월 6, 2016, 10:24오후 UTC](https://meta.discourse.org/t/preformatted-text-or-code-block-does-not-work-in-nested-list/39166 "2016-02-06T22:24:38Z")\
**Posts on this page:** 1\
**Showing post:** 1

<div class="post-metadata">

**Author:** ![jomaxro](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/jomaxro/32/126216_2.png) [@jomaxro](https://meta.discourse.org/u/jomaxro)\
**Post date:** [2월 6, 2016, 10:24오후 UTC](https://meta.discourse.org/t/preformatted-text-or-code-block-does-not-work-in-nested-list/39166/1 "2016-02-06T22:24:38Z")

</div>

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

```plaintext
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

```plaintext
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

5. This should be 3!

---

_[View the full topic](https://meta.discourse.org/t/preformatted-text-or-code-block-does-not-work-in-nested-list/39166)._
