hexo icon indicating copy to clipboard operation
hexo copied to clipboard

Parsing error for code blocks in list items

Open TripleCamera opened this issue 1 year ago • 2 comments

Check List

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

Expected behavior

Code blocks are inside list items.

Actual behavior

Nesting error.

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

[email protected] D:\GitHub\triplecamera.github.io
├── [email protected]
├── [email protected]
├── [email protected]
├── [email protected]
├── [email protected]
├── [email protected]
├── [email protected]
├── [email protected]
├── [email protected]
└── [email protected]

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

TripleCamera avatar Feb 19 '24 12:02 TripleCamera

it may caused by backtick_code_block.ts

https://github.com/hexojs/hexo/blob/6bf9e6c2454f8852e8350fefc1b10666eee9a12c/lib/plugins/filter/before_post_render/backtick_code_block.ts#L4

regexp

uiolee avatar Feb 21 '24 10:02 uiolee

Hi, how is everything going?

TripleCamera avatar Mar 13 '24 08:03 TripleCamera