All Collections
Author Help
How to embed code blocks in lists
How to embed code blocks in lists

Keywords: embed, code, lists, list, list item

Leanpub Support avatar
Written by Leanpub Support
Updated over a week ago

If you really want to do it, then what you do is indent the code block
the same amount as the list item. This will work regardless of whether
you have a blank line between the list item and the code block. An
example is below, and attached as a screenshot.

However, formatted code blocks look terrible as part of list items,
since we do not do indentation nicely. So, we'd strongly recommend not
using lists around formatted code blocks, and just write paragraphs
instead.

# English

The quick sly fox jumped over the lazy dogs.

- **lorem ipsum** lorem ipsum dolor:
```text
$ something something
something
```
- Foo
```ruby
puts foo
```
- Bar
- Baz

Did this answer your question?