v3.1.1February 23, 2018
- 🛠 Fix handling methods and attributes of static arrays, objects and primitives. Solves the issue #937
- ➕ Add support for python-style array slices with Jinja compat enabled. Fixes #188; merge of #976.
- 🛠 Fix call blocks having access to their parent scope. Fixes #906; merge of #994.
- 🛠 Fix a bug that caused capturing block tags (e.g. set/endset, filter/endfilter) to write to the global buffer rather than capturing their contents. Fixes #914 and #972; merge of #990. Thanks Noah Lange.
👍 Allow including many templates without reaching recursion limits. Merge of #787. Thanks Gleb Khudyakov.
👍 Allow explicitly setting
none) as the value of a variable; don't ignore that value and look on up the frame stack or context. Fixes #478. Thanks Jonny Gerig Meyer for the report.
Execute blocks in a child frame that can't write to its parent. This means that vars set inside blocks will not leak outside of the block, base templates can no longer see vars set in templates that inherit them, and
super()can no longer set vars in its calling scope. Fixes the inheritance portion of #561, which fully closes that issue. Thanks legutierr for the report.
👀 Prevent macros from seeing or affecting their calling scope. Merge of #667.
🛠 Fix handling of macro arg with default value which shares a name with another macro. Merge of #791.
➕ Add support for the spaces parameter in the dump template filter. Merge of #868. Thanks Jesse Eikema
verbatimas an alias of
rawfor compatibility with Twig. Merge of #874.
➕ Add new
nl2brfilter. Thanks Marc-Aurèle Darche
➕ Add support for python's
list.appendwith Jinja compat enabled. Thanks Conor Flannigan.
➕ Add variables whitespace control.
elseifas an alias of
eliffor parity with Twig. Thanks kswedberg. Merge of #826.
➕ Add nunjucks env to express app settings as
nunjucksEnv. Merge of #829.
➕ Add support for finding an object's "length" in length filter. Merge of #813.
💅 Ensure that precompiling on Windows still outputs POSIX-style path separators. Merge of #761.
➕ Add support for strict type check comparisons (=== and !==). Thanks oughter. Merge of #746.
👍 Allow full expressions (incl. filters) in import and from tags. Thanks legutierr. Merge of #710.
🔀 OS agnostic file paths in precompile. Merge of #825.
🔀 Don't double-escape. Thanks legutierr. Merge of #701.
🔀 Prevent filter.escape from escaping SafeString. Thanks atian25. Merge of #623.
Throw an error if a block is defined multiple times. Refs #696.
🔀 Officially recommend the
.njkextension. Thanks David Kebler. Merge of #691.
👍 Allow block-set to wrap an inheritance block. Unreported; fixed as a side effect of the fix for #576.
filtertag with non-trivial contents. Thanks Stefan Cruz and Fabien Franzen for report and investigation, Jan Oopkaup for failing tests. Fixes #576.