Ordered list with code blocks not resuming the order

I’m not sure where to ask this question. I am using hermit theme. I have written a code block, and I have placed them between two list items.

The recommended way to write code according to hermit docs (similar to StackOverflow):

```javascript
var num1, num2, sum```

My try:

Case #1

1. Lorem ipsum dolor sit amet.

```toml
[section]
key = "value"```

2. Lorem ipsum dolor sit amet.

Rendered output (no continuation).

image

Case #2

So how to continue numbered list? I tried this:

1. Lorem ipsum dolor sit amet.

    ```toml
    [section]
    key = "value"
    ```

2. Lorem ipsum dolor sit amet.

Syntax highlighting is retained, but the second item is 1. is offset 2. not in continuation.

image

Case #3

Let’s try this:

1. Lorem ipsum dolor sit amet.

    [section]
    key = "value"

2. Lorem ipsum dolor sit amet.

Wow! Continuation is retained, code block is gone.

image

Case #4

I’ll double indent the code block and let’s see what happens:

1. Lorem ipsum dolor sit amet.

        [section]
        key = "value"

2. Lorem ipsum dolor sit amet.

Code block and numbering both are retained, but syntax highlighting is unhappy.

image

I don’t know at which level this is happening, either Hugo (markdown parsing) or my theme hermit (custom css). Can we put language specification in the last method? Can somebody help me on this?

Looks like you have to add line break before the code blocks

I dont know which hugo version you use, so perhaps you can try use the following workaround to create line break

  • add two spaces right after last character in the first line
  • add  
  • add \
  • add <br>

for example


1. Lorem ipsum dolor sit amet\

```toml
[section]
key = "value"```

2. Lorem ipsum dolor sit amet.

Hi there,

I am using, v0.59.1 right now.

I have tried all the mentioned method one by one, none of them was able to continue the sequence.