jinja
jinja copied to clipboard
A very fast and expressive template engine.
Clarifies what operations the default `Undefined` supports. Before this change, the only indication that boolean expressions were supported was one of the examples.
For now, the custom extension (which returns an AssignBlock) can only bind string data to new variables. But it's useful if we can save any type. Related: https://github.com/pallets/jinja/issues/714 If the...
`unique()` filter does not work when chain with a filter that returns async generator Environment: - Python version: 3.11 - Jinja version: 3.1.2 The template: ``` {%- set commit_authors =...
Add `Environment.extract_parsed_names` to support tracking dynamic inheritance or inclusion. Compared to `jinja2.meta.find_referenced_templates()`, it: a. works on dynamic inheritance and includes b. does not work unless and until you actually render...
`jinja2.meta.find_referenced_templates` does not support dynamic inheritance or inclusion.
Added the `@render_time_only` decorator for filters and tests. It marks filters to not be resolved at compile time even if the arguments are constants. This can be useful as described...
Replaces undefined name `autoescape` with the `eval_ctx` attribute of the same name. Fixes #1769
The `nl2br` example in the [custom filters documentation section](https://jinja.palletsprojects.com/en/3.0.x/api/#custom-filters) uses the undefined name `autoescape`.
Implements `ext.i18n.newstyle_fallback_interpolation` policy which can be set to `True` to gracefully fallback to untranslated strings if an interpolation error occurs due to incorrectly or out-of-date named variables in translations. -...
Similar to #421 when translation strings are not kept perfectly up to date, changes to the names of variables in strings can break behavior on a site. I'd like to...