-
-
Notifications
You must be signed in to change notification settings - Fork 4.9k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Inconsistent check for Nunjucks disabling flag #3860
Comments
PR welcome |
By chance could it help with #3259 ? |
hexo.extend.renderer.register('md', 'html', (data, { disableNunjucks: true }) => {
// ...
}); For example this plugin https://github.com/think-in-universe/hexo-stop-tag-plugins disables all nunjucks in markdown files. A side effect is that tag plugin |
This issue has been automatically marked as stale because lack of recent activity. It will be closed if no further activity occurs. Thank you for your contributions. |
unstale |
This issue has been automatically marked as stale because lack of recent activity. It will be closed if no further activity occurs. Thank you for your contributions. |
Nunjucks disabling flag check is potentially broken because of inconsistency of logic of passing and checking
disableNunjucks
parameter from renderers.As of v4.0.0
disableNunjucks
flag is defined by checking corresponding flag from renderer that is received throughget()
method. Thisget()
method selects between normal and sync stores, but uses normal store by default. However, as can be seen from renderer registration method, this normal store containsPromise
and hence provides no access todisableNunjucks
flag that can be passed from renderer. Such flag will be stored intostoreSync
which contains original renderer function.Correct code for
disableNunjucks
flag checking should usestoreSync
:notice second
true
argument forget()
.The text was updated successfully, but these errors were encountered: