Skip to content
This repository was archived by the owner on Mar 11, 2025. It is now read-only.
This repository was archived by the owner on Mar 11, 2025. It is now read-only.

Feature/docs request: allow setting escape="none" in askama.toml #1060

@sxlijin

Description

@sxlijin

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 blanket escape = "none" in askama.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.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions