Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

折疊塊內部的行內程式碼區塊不會跳脫 #1091

Open
3 tasks done
zen8841 opened this issue May 1, 2024 · 0 comments
Open
3 tasks done

折疊塊內部的行內程式碼區塊不會跳脫 #1091

zen8841 opened this issue May 1, 2024 · 0 comments
Labels
🐛 bug Unexpected problem or unintended behavior

Comments

@zen8841
Copy link

zen8841 commented May 1, 2024

请确认

  • 是当前最新的 Release 版本
  • 本地 hexo clean && hexo s,并且清除浏览器缓存,仍可复现
  • 已经排除是其他 Hexo 插件影响

Bug 描述

在折疊塊內部使用行內程式碼時,如果其中包含<code>的標簽,並不會將其跳脫,會導致在這個折疊塊結束後都無法使用行內程式碼

复现步骤

该 Bug 复现步骤如下:

  1. 新建全新的hexo安裝fluid主題
  2. 對任何一篇文章修改,加入以下的內容
{% fold info @title %}
`<code>`

`test`

{% endfold %}

`test`
  1. 這時不管hexo g或是hexo s都會報錯
Template render error: (unknown path)
  unexpected end of file
    at Object._prettifyError (-/test/node_modules/nunjucks/src/lib.js:32:11)
    at Template.render (-/test/node_modules/nunjucks/src/environment.js:442:21)
    at Environment.renderString (-/test/node_modules/nunjucks/src/environment.js:313:17)
    at -/test/node_modules/hexo/dist/extend/tag.js:206:22
    at tryCatcher (-/test/node_modules/bluebird/js/release/util.js:16:23)
    at Promise.fromNode.Promise.fromCallback (-/test/node_modules/bluebird/js/release/promise.js:209:30)
    at Tag.render (-/test/node_modules/hexo/dist/extend/tag.js:205:35)
    at Object.onRenderEnd (-/test/node_modules/hexo/dist/hexo/post.js:403:32)
    at -/test/node_modules/hexo/dist/hexo/render.js:77:29
    at tryCatcher (-/test/node_modules/bluebird/js/release/util.js:16:23)
    at Promise._settlePromiseFromHandler (-/test/node_modules/bluebird/js/release/promise.js:547:31)
    at Promise._settlePromise (-/test/node_modules/bluebird/js/release/promise.js:604:18)
    at Promise._settlePromise0 (-/test/node_modules/bluebird/js/release/promise.js:649:10)
    at Promise._settlePromises (-/test/node_modules/bluebird/js/release/promise.js:729:18)
    at _drainQueueStep (-/test/node_modules/bluebird/js/release/async.js:93:12)
    at _drainQueue (-/test/node_modules/bluebird/js/release/async.js:86:9)
    at Async._drainQueues (-/test/node_modules/bluebird/js/release/async.js:102:5)
    at Async.drainQueues (-/test/node_modules/bluebird/js/release/async.js:15:14)
    at process.processImmediate (node:internal/timers:478:21)
  1. 如果刪除折疊塊外部的行內程式碼就可以正常渲染
  2. 如果將折疊塊移除也可以正常渲染

暫時解決方法

在出問題的行內程式碼後方將其補全

{% fold info @title %}
`<code>`</code>

`test`

{% endfold %}

`test`
@zen8841 zen8841 added the 🐛 bug Unexpected problem or unintended behavior label May 1, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
🐛 bug Unexpected problem or unintended behavior
Projects
None yet
Development

No branches or pull requests

1 participant