You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
In pandoc we can assign id to a generated html tag by
:::{#id-of-tag}
Content of this block
:::
However, this can not be rendered correctly. Actaully, content after this block is truncated. This is obvious caused by nunjuncks compatibility, where {# #} is a valid block. To be more specific, in hexo/lib/hexo/post.js, if disableNunjucks is not set, then the content of the post will be processed in the following way:
Thus the content after {# is truncated (It will try to find the coresponded #} till the end of the post). To address this problem, you need to do two things:
In hexo-renderer-pandoc, make sure you set pandocRenderer.disableNunjucks = true
Upgrade hexo to 7.0.0. If you still using hexo 6.x.x, you need to fix a bug manually by editting hexo/lib/extend/renderer.js . Find register method of class Renderer and make sure it looks like this:
register(name,output,fn,sync){if(!name)thrownewTypeError('name is required');if(!output)thrownewTypeError('output is required');if(typeoffn!=='function')thrownewTypeError('fn must be a function');name=getExtname(name);output=getExtname(output);if(sync){this.storeSync[name]=fn;this.storeSync[name].output=output;this.store[name]=Promise.method(fn);}else{if(fn.length>2)fn=Promise.promisify(fn);this.store[name]=fn;}this.store[name].output=output;this.store[name].compile=fn.compile;this.store[name].disableNunjucks=fn.disableNunjucks;// <--- this is the added line!}}
The text was updated successfully, but these errors were encountered:
In pandoc we can assign id to a generated html tag by
However, this can not be rendered correctly. Actaully, content after this block is truncated. This is obvious caused by nunjuncks compatibility, where
{# #}
is a valid block. To be more specific, inhexo/lib/hexo/post.js
, ifdisableNunjucks
is not set, then the content of the post will be processed in the following way:Thus the content after
{#
is truncated (It will try to find the coresponded#}
till the end of the post). To address this problem, you need to do two things:hexo-renderer-pandoc
, make sure you setpandocRenderer.disableNunjucks = true
hexo/lib/extend/renderer.js
. Findregister
method of classRenderer
and make sure it looks like this:The text was updated successfully, but these errors were encountered: