Code blocks and Indention

  • 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.

Can you please send a video of this issue?

Here you are:

Our markdown is based on the CommonMark spec. 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.

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.

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