azu / azu/gitbook-plugin-include-codeblock

Error When Importing YAML with {{}} Markup

未關閉
#80 6 則留言 0 個 reaction 已指派 0 人 在 GitHub 檢視
bug
主要語言
JavaScript
星號
40
分支
25
PR 合併指標
30 天內沒有已合併 PR

描述

Hello,

I’ve encountered an issue when importing YAML content that includes `{{}}`. This expression often appears in the GitHub Actions definitions documentation. It appears that HTML markup is being applied to the text within the {{}}, which causes rendering failures during nunjucks processing.

```
error: error while generating page "MY_DOCUMENT.md":
Template render error: (/home/USER_NAME/path/to/file/MY_DOCUMENT.md) [Line 62, Column 220]
unexpected token: <
at Object._prettifyError (/home/USER_NAME/PROJECT_DIR/node_modules/nunjucks/src/lib.js:32:11)
at Template.render (/home/USER_NAME/PROJECT_DIR/node_modules/nunjucks/src/environment.js:442:21)
at Environment.renderString (/home/USER_NAME/PROJECT_DIR/node_modules/nunjucks/src/environment.js:313:17)
at Promise.apply (/home/USER_NAME/PROJECT_DIR/node_modules/q/q.js:1185:26)
at Promise.promise.promiseDispatch (/home/USER_NAME/PROJECT_DIR/node_modules/q/q.js:808:41)
at /home/USER_NAME/PROJECT_DIR/node_modules/q/q.js:1411:14
at runSingle (/home/USER_NAME/PROJECT_DIR/node_modules/q/q.js:137:13)
at flush (/home/USER_NAME/PROJECT_DIR/node_modules/q/q.js:125:13)
at process.processTicksAndRejections (node:internal/process/task_queues:77:11)
```

**Steps to Reproduce:**

Import YAML content containing {{}} into the markdown, and set "YAML" as lang.
Then, convert this document using honkit such as `npx honkit pdf`

**Expected Behavior:** The content within {{}} should not have HTML markup applied, as it seems to interfere with the nunjucks rendering process.

**Actual Behavior:** HTML markup is applied to the content within {{}}, leading to rendering errors with nunjucks.

**Possible Solution:** A potential fix would be to adjust the import process to exclude the application of HTML markup to the content within {{}}. This should allow for successful rendering with nunjucks without encountering errors.

Thank you for looking into this issue. I believe addressing this could improve the experience.

貢獻指南

這個儲存庫沒有索引到貢獻指南

研究方向

透過匯入包含 {{}} 的 YAML 並執行 npx honkit pdf 來重現失敗。追蹤在 nunjucks 處理之前套用 HTML 標記的匯入路徑。當 {{}} 內容維持未標記狀態,且文件在沒有報告的 nunjucks 錯誤的情況下完成渲染時,即表示完成。

由索引模型根據 Issue 內容生成。

評估

技術堆疊
javascript
領域
tooling
Issue 類型
缺陷
難度
3/5
預估耗時
1-2 天
活躍度
停滯
描述清晰度
基本清楚
新手友好度
28/100

把新 issue 寄到你的電子郵件信箱

精選適合新手參與的 GitHub issue 摘要。