Insert the code block causes the ordered list of discontinuity
shepherdlazy opened this issue · 3 comments
shepherdlazy commented
a. Example Normal
- The first
this is contents of.
Random ro = new Random();
- Second
- Third
b. Example Abnormal
- The first
this is contents of.
Random ro = new Random();
- Second
- Third
Source Code
#### a. Example Normal
1. The first
this is contents of.
`Random ro = new Random();`
2. Second
3. Third
#### b. Example Abnormal
1. The first
this is contents of.
\```csharp
Random ro = new Random();
\```
2. Second
3. Third
mdiep commented
Markdown requires new block-level elements in a list item to be indented by 4 spaces. So in order for the code block to not reset the list, you need to add 4 spaces before the backticks.
b. Example Abnormal
- The first
this is contents of.
csharp Random ro = new Random();
- Second
- Third
Source:
#### b. Example Abnormal
1. The first
this is contents of.
```csharp
Random ro = new Random();
\```
2. Second
3. Third
shepherdlazy commented
@mdiep Thank you! but I inserted in the code segment of 4 spaces will make the code block cannot indentation and bright.
b. Example Abnormal
- The first
this is contents of.
csharp int i=0; Random ro = new Random();
- Second
- Third
source code
#### b. Example Abnormal
1. The first
this is contents of.
```csharp
int i=0;
Random ro = new Random();
\```
2. Second
3. Third
mdiep commented
I didn't think of it at the time, but that's because there needs to be a blank line between the list item's paragraph and the code block. Otherwise, the code black is considered to be a code span and is part of the paragraph.
b. Example Abnormal
-
The first
this is contents of.Random ro = new Random();
-
Second
-
Third
Source Code
#### b. Example Abnormal
1. The first
this is contents of.
```csharp
Random ro = new Random();
\```
2. Second
3. Third