azu / azu/gitbook-plugin-include-codeblock

Error When Importing YAML with {{}} Markup

Đang mở
#80 6 bình luận 0 reaction 0 người được giao Xem trên GitHub
bug
Ngôn ngữ chính
JavaScript
Star
40
Fork
25
Chỉ số merge pull request
Không có pull request nào được merge trong 30 ngày

Mô tả

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.

Hướng dẫn đóng góp

Chưa lập chỉ mục được hướng dẫn đóng góp cho kho mã nguồn này

Hướng nghiên cứu

Reproduce the failure by importing YAML containing {{}} and running npx honkit pdf. Trace the import path where HTML markup is applied before nunjucks processing. Done means the {{}} content remains unmarked and the document renders without the reported nunjucks error.

Do mô hình lập chỉ mục viết ra từ nội dung của issue.

Đánh giá

Công nghệ
javascript
Lĩnh vực
tooling
Loại issue
Lỗi
Độ khó
3/5
Thời gian dự kiến
1-2 ngày
Mức độ hoạt động
Đình trệ
Độ rõ ràng
Khá rõ ràng
Mức phù hợp với người mới
28/100

Nhận issue mới trong hộp thư của bạn

Bản tóm tắt ngắn những issue GitHub phù hợp với người mới.