Error : conflict between latex and nunjucks
laBecasse opened this issue · 1 comments
laBecasse commented
Hi again,
there is a error on the following post:
---
title: Hello World
---
$$\mathbb{{{x}}}$$
This multiple brackets can be include naturally by the use of latex macros with \newcommand
allowed by pandoc.
The error is due to nunjucks considering the brackets template tags:
Unhandled rejection Template render error: (unknown path) [Line 1, Column 40]
parseAggregate: expected colon after dict key
at Object._prettifyError (/home/user/blog/node_modules/nunjucks/src/lib.js:36:11)
at Template.render (/home/user/blog/node_modules/nunjucks/src/environment.js:524:21)
at Environment.renderString (/home/user/blog/node_modules/nunjucks/src/environment.js:362:17)
at Promise (/home/user/blog/node_modules/hexo/lib/extend/tag.js:66:9)
at Promise._execute (/home/user/blog/node_modules/bluebird/js/release/debuggability.js:313:9)
at Promise._resolveFromExecutor (/home/user/blog/node_modules/bluebird/js/release/promise.js:483:18)
at new Promise (/home/user/blog/node_modules/bluebird/js/release/promise.js:79:10)
at Tag.render (/home/user/blog/node_modules/hexo/lib/extend/tag.js:64:10)
at Object.tagFilter [as onRenderEnd] (/home/user/blog/node_modules/hexo/lib/hexo/post.js:230:16)
at Promise.then.then.result (/home/user/blog/node_modules/hexo/lib/hexo/render.js:65:19)
at tryCatcher (/home/user/blog/node_modules/bluebird/js/release/util.js:16:23)
at Promise._settlePromiseFromHandler (/home/user/blog/node_modules/bluebird/js/release/promise.js:512:31)
at Promise._settlePromise (/home/user/blog/node_modules/bluebird/js/release/promise.js:569:18)
at Promise._settlePromise0 (/home/user/blog/node_modules/bluebird/js/release/promise.js:614:10)
at Promise._settlePromises (/home/user/blog/node_modules/bluebird/js/release/promise.js:694:18)
at Promise._fulfill (/home/user/blog/node_modules/bluebird/js/release/promise.js:638:18)
I propose to disable (or add an option to disable) nunjucks with hexo-renderer-pandoc. There are several known issues with nunjucks. And there is a way to disable it.
We can do it this way : https://github.com/laBecasse/hexo-renderer-pandoc/blob/511e19a162a907f103304e5d0e50aa238ebc70d4/index.js#L95
wzpan commented
Sounds reasonable. I will update it.