Skip to content

Releases: pallets/jinja

3.0.0rc2

25 Apr 15:16
ac8d8d6
Compare
Choose a tag to compare
3.0.0rc2 Pre-release
Pre-release

Fixes an issue with the deprecated Markup subclass, #1401.

3.0.0rc1

16 Apr 15:26
d77a91b
Compare
Choose a tag to compare

2.11.3

31 Jan 17:15
cf21539
Compare
Choose a tag to compare

This contains a fix for a speed issue with the urlize filter. urlize is likely to be called on untrusted user input. For certain inputs some of the regular expressions used to parse the text could take a very long time due to backtracking. As part of the fix, the email matching became slightly stricter. The various speedups apply to urlize in general, not just the specific input cases.

2.11.2

13 Apr 17:01
737a4cd
Compare
Choose a tag to compare

2.11.1

30 Jan 21:09
b85283e
Compare
Choose a tag to compare

This fixes an issue in async environment when indexing the result of an attribute lookup, like {{ data.items[1:] }}.

2.11.0

29 Jan 06:41
bbdafe3
Compare
Choose a tag to compare

This is the last version to support Python 2.7 and 3.5. The next version will be Jinja 3.0 and will support Python 3.6 and newer.

2.10.3

04 Oct 19:00
c6a71f9
Compare
Choose a tag to compare

2.10.2

04 Oct 18:29
0fee409
Compare
Choose a tag to compare

2.10.1

06 Apr 20:17
c4c4088
Compare
Choose a tag to compare

2.10

08 Nov 20:14
78d2f67
Compare
Choose a tag to compare

Primary changes

Install or upgrade

Install from PyPI with pip:

pip install -U Jinja2

Changelog

  • Added a new extension node called OverlayScope which can be used to create an unoptimized scope that will look up all variables from a derived context.
  • Added an in test that works like the in operator. This can be used in combination with reject and select.
  • Added previtem and nextitem to loop contexts, providing access to the previous/next item in the loop. If such an item does not exist, the value is undefined.
  • Added changed(*values) to loop contexts, providing an easy way of checking whether a value has changed since the last iteration (or rather since the last call of the method)
  • Added a namespace function that creates a special object which allows attribute assignment using the set tag. This can be used to carry data across scopes, e.g. from a loop body to code that comes after the loop.
  • Added a trimmed modifier to {% trans %} to strip linebreaks and surrounding whitespace. Also added a new policy to enable this for all trans blocks.
  • The random filter is no longer incorrectly constant folded and will produce a new random choice each time the template is rendered. (#478)
  • Added a unique filter. (#469)
  • Added min and max filters. (#475)
  • Added tests for all comparison operators: eq, ne, lt, le, gt, ge. (#665)
  • import statement cannot end with a trailing comma. (#617, #618)
  • indent filter will not indent blank lines by default. (#685)
  • Add reverse argument for dictsort filter. (#692)
  • Add a NativeEnvironment that renders templates to native Python types instead of strings. (#708)
  • Added filter support to the block set tag. (#489)
  • tojson filter marks output as safe to match documented behavior. (#718)
  • Resolved a bug where getting debug locals for tracebacks could modify template context.
  • Fixed a bug where having many {% elif ... %} blocks resulted in a "too many levels of indentation" error. These blocks now compile to native elif ..: instead of else: if ..: (#759)