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?

I suggest the Hugo forum, https://discourse.gohugo.io/

This topic was automatically closed 90 days after the last reply. New replies are no longer allowed.