azu / azu/gitbook-plugin-include-codeblock

Error When Importing YAML with {{}} Markup

Abierto
#80 6 comentarios 0 reacciones 0 asignados Ver en GitHub
bug
Lenguaje dominante
JavaScript
Estrellas
40
Forks
25
Métricas de merge de PR
Sin PR fusionados en 30 d

Descripción

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.

Guía de contribución

No hay ninguna guía de contribución indexada para este repositorio

Línea de trabajo

Reproduce el fallo importando YAML que contenga {{}} y ejecutando npx honkit pdf. Rastrea la ruta de importación en la que se aplica el marcado HTML antes del procesamiento de nunjucks. Se considera terminado cuando el contenido {{}} permanece sin marcado y el documento se renderiza sin el error de nunjucks indicado.

Escrito por el modelo de indexación a partir del texto del issue.

Evaluación

Stack tecnológico
javascript
Área
tooling
Tipo de issue
Error
Dificultad
3/5
Tiempo estimado
1-2 días
Estado de actividad
Estancado
Claridad
Bastante claro
Aptitud para principiantes
28/100

Recibe los nuevos issues en tu correo

Un resumen breve de issues de GitHub para principiantes.