-
-
Notifications
You must be signed in to change notification settings - Fork 224
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
Feature/docs request: allow setting escape="none" in askama.toml #1060
Comments
I think you could do it like this? [[escaper]]
path = "::askama::Text"
extensions = ["rs"] # Add whatever extensions you need here Internally, Please try it, and if it works it would be great if you can submit a docs PR! |
Thanks for the quick reply, and sorry for the slow response- this is very far off the daily work track, so it's hard to make time for this. Unfortunately this doesn't appear to work; when using this with a
I get this:
If I find time to drill into a minimum repro, I'll let you know. (Aside: I really hate the lack of template filename suffix standardization. I've personally standardized every codebase I use on |
We're using askama for codegen (thanks for the wonderful work!) and all of our templates are instantiated with
#[template(path = ..., escape = "none)]
. It would be nice if we could just set a blanketescape = "none"
inaskama.toml
.I suspect that, given askama supports custom escapers, which are much more complex, this is possible - but looking at https://djc.github.io/askama/configuration.html#custom-syntaxes I have no idea how to actually do this.
https://github.com/djc/askama/blob/34f84dc10f291a6bd7fc3af2c01da20c9ccd51e5/askama_derive/src/config.rs#L302-L306 suggests that
default_escapers
is a 2-tuple of file-extension-list to rust-escaper-function - but it's unclear to me how this would be modeled in askama.toml.The text was updated successfully, but these errors were encountered: