-
Notifications
You must be signed in to change notification settings - Fork 2.4k
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
Custom delimiters do not work in nested partials #738
Comments
aielo
added a commit
to aielo/mustache.js
that referenced
this issue
Feb 25, 2020
aielo
added a commit
to aielo/mustache.js
that referenced
this issue
Feb 25, 2020
aielo
added a commit
to aielo/mustache.js
that referenced
this issue
Feb 25, 2020
aielo
changed the title
Custom delimiters do not work in inner partials
Custom delimiters do not work in nested partials
Feb 25, 2020
Very sorry for the late response, been more busy than usual lately. Thanks a bunch for the very elaborate description of what you've stumbled onto and steps to reproduce, much appreciated 👍 |
aielo
added a commit
to aielo/serverless-enhanced-config
that referenced
this issue
Mar 16, 2020
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Custom delimiters only work in the template itself and its (level 1) partials (thanks to #679). For inner partials (level 2+), however, default tags are used rather than the custom ones provided in
render
.This behavior can be reproduced with the sample code:
Double brackets are set as custom tags in
const tags = ["[[", "]]"]
, and it outputs:[[> level1 ]]
in template and[[> level2 ]]
in the first level partial are properly resolved, while the first inner partial[[> level3 ]]
is left unresolved.Switching to
const tags = ["[[{{", "}}]]"]
, and keeping the curly brackets within custom delimiters, it outputs:Here, custom tags are again used in template and first level partial. Default Mustache tags are then used in inner partials, rendering them wrongly.
Overriding
Mustache.tags
works normally. Changing the sample code:Output is the expected:
The text was updated successfully, but these errors were encountered: