# Code blocks and Indention

**URL:** <https://community.bear.app/t/code-blocks-and-indention/15126>\
**Category:** Bear Bug Report\
**Created:** [February 15, 2025, 2:18pm UTC](https://community.bear.app/t/code-blocks-and-indention/15126 "2025-02-15T14:18:49Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![nami](https://avatars.discourse-cdn.com/v4/letter/n/f08c70/32.png) [@nami](https://community.bear.app/u/nami)\
**Post date:** [February 15, 2025, 2:18pm UTC](https://community.bear.app/t/code-blocks-and-indention/15126/1 "2025-02-15T14:18:49Z")

</div>

- **Bear Version** : 2.3.10
- **OS Version** : 15.3
- **What feature did you use** : Code Blocks and Lists
- **What happened** : The code blocks don’t work correctly and can’t perform syntax highlighting for different programming languages if we indent them.
- **What did you expect to happen** : The code blocks should be able to easily indent as much as users want, so they can be used conveniently in lists.

Thank you very much.

---

<div class="post-metadata">

**Author:** ![trix180](https://dub1.discourse-cdn.com/flex013/user_avatar/community.bear.app/trix180/32/588_2.png) [@trix180](https://community.bear.app/u/trix180)\
**Post date:** [February 17, 2025, 8:50am UTC](https://community.bear.app/t/code-blocks-and-indention/15126/2 "2025-02-17T08:50:59Z")

</div>

Can you please send a video of this issue?

---

<div class="post-metadata">

**Author:** ![nami](https://avatars.discourse-cdn.com/v4/letter/n/f08c70/32.png) [@nami](https://community.bear.app/u/nami)\
**Post date:** [February 17, 2025, 6:48pm UTC](https://community.bear.app/t/code-blocks-and-indention/15126/3 "2025-02-17T18:48:18Z")

</div>

Here you are:

---

<div class="post-metadata">

**Author:** ![rexikan](https://dub1.discourse-cdn.com/flex013/user_avatar/community.bear.app/rexikan/32/4117_2.png) [@rexikan](https://community.bear.app/u/rexikan)\
**Post date:** [February 18, 2025, 7:32am UTC](https://community.bear.app/t/code-blocks-and-indention/15126/4 "2025-02-18T07:32:10Z")

</div>

> [@nami](#):
>
> The code blocks should be able to easily indent as much as users want, so they can be used conveniently in lists.

Our markdown is based on the [CommonMark spec](https://spec.commonmark.org/0.31.2/). As you say, indentation is used to add things to list items and to make sub-lists.

The example from you video have a list item followed by a code block. That is, the list ended at the first line so indenting the second line doesn’t do anything.

````auto
1. Item 1
```
var x = 1;
```

````

If you want the first code block to be part of the list item, you need to indent it. Then the list extends all the way down and you can add more to it by indenting.

````auto
1. Item 1
   ```
   var x = 1;
   ```

````
