Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Insert the code block causes the ordered list of discontinuity #57

Open
shepherdlazy opened this issue Jun 15, 2014 · 3 comments
Open

Comments

@shepherdlazy
Copy link

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.
Random ro = new Random();
  1. Second
  2. 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
Copy link

mdiep commented Jun 15, 2014

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

  1. The first
    this is contents of.
    csharp Random ro = new Random();
  2. Second
  3. Third

Source:

#### b. Example Abnormal
1. The first    
 this is contents of.  
    ```csharp
Random ro = new Random();
\```
2. Second
3. Third

@shepherdlazy
Copy link
Author

@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

  1. The first
    this is contents of.
    csharp int i=0; Random ro = new Random();
  2. Second
  3. 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
Copy link

mdiep commented Aug 27, 2014

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

  1. The first
    this is contents of.

    Random ro = new Random();
  2. Second

  3. Third

Source Code

#### b. Example Abnormal
1. The first
this is contents of.

    ```csharp
Random ro = new Random();
\```
2. Second
3. Third

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants