feat(environment): add auto escape callback for templates - #902
Open
qlux wants to merge 1 commit into
Open
Conversation
--- Co-Authored-By: Claude Opus <noreply@anthropic.com>"
mitsuhiko
requested changes
Aug 3, 2026
mitsuhiko
left a comment
Owner
There was a problem hiding this comment.
Thanks! The core html/json/none behavior works locally, but I don't think this is ready to merge yet:
- The custom-format branch leaks a new allocation on every callback invocation via
Box::leak. The JS binding does not expose a custom formatter, so this advertised mode cannot actually render and currently just errors. Please restrict the return values to the supported modes (or otherwise avoid the per-call leak). - Please add JS tests covering the callback/name and escaping behavior.
- Please update
minijinja-js/README.md, which still lists custom auto-escape callbacks as unsupported.
I verified that the branch compiles and that the existing JS test suite passes after merging current main.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
Expose the autoescape parameter to the js binding.
Co-Authored-By: Claude Opus noreply@anthropic.com