Skip to content

Parsing error for code blocks in list items #5423

@TripleCamera

Description

@TripleCamera

Check List

  • I have already read Docs page & Troubleshooting page.
  • I have already searched existing issues and they are not help to me.
  • I examined error or warning messages and it's difficult to solve.
  • I am using the latest version of Hexo. (run hexo version to check)
  • My Node.js is matched the required version.

Expected behavior

Code blocks are inside list items.

Actual behavior

Nesting error.

Image

<ol>
  <li>
    <pre><code>A code block.
    <figure class="highlight plaintext"><table><tbody><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br></pre></td><td class="code"><pre><span class="line">2.  ```</span><br><span class="line">    Another code block.</span><br></pre></td></tr></tbody></table></figure>
    </code></pre>
  </li>
</ol>

How to reproduce?

Render the following lines:

1.  ```
    A code block.
    ```
2.  ```
    Another code block.
    ```

Here is a live example on my blog.

Is the problem still there under Safe mode?

Cannot generate pages at all under safe mode.

Your Node.js & npm version

v20.11.0
10.2.4

Your Hexo and Plugin version

hexo-site@0.0.0 D:\GitHub\triplecamera.github.io
├── hexo-generator-archive@2.0.0
├── hexo-generator-category@2.0.0
├── hexo-generator-index@3.0.0
├── hexo-generator-tag@2.0.0
├── hexo-renderer-ejs@2.0.0
├── hexo-renderer-pandoc@0.4.0
├── hexo-renderer-stylus@3.0.1
├── hexo-server@3.0.0
├── hexo-theme-next@8.19.1
└── hexo@7.1.1

Your package.json

See https://github.com/TripleCamera/triplecamera.github.io.

Your site's _config.yml (Optional)

See https://github.com/TripleCamera/triplecamera.github.io.

Others

No response

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions