Document global Mustache.escape overriding capacity #644
+3
−1
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Right now, the capacity to override HTML-escaping of strings globally isn't documented. Not only that, but the end of the main issue where this is discussed #244 proposes a solution that got implemented, but with a name that's slightly different from the actual user-facing name. (The proposed solution is to overwrite
Mustache.escapeHTML
, but the actual name that client-facing code has to override isMustache.escape
--- which is only discovered if you dig down further and find #307.This capacity is super-useful, especially when combined with custom delimiters (where triple-mustache won't work). For example, I'm using Mustache to template LaTeX right now, and the capacity to override escaping globally is essential to keep me from going nuts.
This PR just adds a line documenting this behavior.