hexojs / hexo

A fast, simple & powerful blog framework, powered by Node.js.
https://hexo.io
MIT License
39.57k stars 4.86k forks source link

hexo g is truncated by {# #5437

Closed zh-Closure closed 7 months ago

zh-Closure commented 8 months ago

Check List

Expected behavior

Displaying the rest of the content normally.

Actual behavior

When using hexo g to generate static web pages, if there is '{#' in the source file, a truncation issue may occur, and the subsequent content will not be displayed.

{B81BD6E6-9C74-411b-ACC2-0AC623E4127F} {7092A4C6-544D-4e73-95A1-5164218B183B}

How to reproduce?

By writing {#} in the markdown file and triggering hexo g.

Is the problem still there under Safe mode?

I used --safe, but the problem still exists.

Your Node.js & npm version

> node -v
v18.16.0
> npm -v
9.5.1

Your Hexo and Plugin version

No response

Your package.json

No response

Your site's _config.yml (Optional)

No response

Others

No response

uiolee commented 8 months ago

I guess you are using the old version of hexo. Please use the latest version.

https://github.com/hexojs/hexo/commit/c1c5aaaf95552f009f9d35a78f0e3b395866e7b8 had make some changes in this problem. In hexo@7.1.1 , if you use the incomplete nunjuck tag {#}, nunjuck will throw error.

uiolee commented 7 months ago

Duplicate of #5301