Jinja

Latest version: v1.2

Safety actively analyzes 681866 Python packages for vulnerabilities to keep your Python projects secure.

Scan your dependencies

Page 3 of 8

2.10

------------

Released 2017-11-08

- 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.
:pr:`478`
- Added a ``unique`` filter. :pr:`469`
- Added ``min`` and ``max`` filters. :pr:`475`
- Added tests for all comparison operators: ``eq``, ``ne``, ``lt``,
``le``, ``gt``, ``ge``. :pr:`665`
- ``import`` statement cannot end with a trailing comma. :pr:`617`,
:pr:`618`
- ``indent`` filter will not indent blank lines by default. :pr:`685`
- Add ``reverse`` argument for ``dictsort`` filter. :pr:`692`
- Add a ``NativeEnvironment`` that renders templates to native Python
types instead of strings. :pr:`708`
- Added filter support to the block ``set`` tag. :pr:`489`
- ``tojson`` filter marks output as safe to match documented behavior.
:pr:`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 ..:`` :issue:`759`

2.9.6

-------------

Released 2017-04-03

- Fixed custom context behavior in fast resolve mode :issue:`675`

2.9.5

-------------

Released 2017-01-28

- Restored the original repr of the internal ``_GroupTuple`` because
this caused issues with ansible and it was an unintended change.
:issue:`654`
- Added back support for custom contexts that override the old
``resolve`` method since it was hard for people to spot that this
could cause a regression.
- Correctly use the buffer for the else block of for loops. This
caused invalid syntax errors to be caused on 2.x and completely
wrong behavior on Python 3 :issue:`669`
- Resolve an issue where the ``{% extends %}`` tag could not be used
with async environments. :issue:`668`
- Reduce memory footprint slightly by reducing our unicode database
dump we use for identifier matching on Python 3 :issue:`666`
- Fixed autoescaping not working for macros in async compilation mode.
:issue:`671`

2.9.4

-------------

Released 2017-01-10

- Solved some warnings for string literals. :issue:`646`
- Increment the bytecode cache version which was not done due to an
oversight before.
- Corrected bad code generation and scoping for filtered loops.
:issue:`649`
- Resolved an issue where top-level output silencing after known
extend blocks could generate invalid code when blocks where
contained in if statements. :issue:`651`
- Made the ``truncate.leeway`` default configurable to improve
compatibility with older templates.

2.9.3

-------------

Released 2017-01-08

- Restored the use of blocks in macros to the extend that was possible
before. On Python 3 it would render a generator repr instead of the
block contents. :issue:`645`
- Set a consistent behavior for assigning of variables in inner scopes
when the variable is also read from an outer scope. This now sets
the intended behavior in all situations however it does not restore
the old behavior where limited assignments to outer scopes was
possible. For more information and a discussion see :issue:`641`
- Resolved an issue where ``block scoped`` would not take advantage of
the new scoping rules. In some more exotic cases a variable
overridden in a local scope would not make it into a block.
- Change the code generation of the ``with`` statement to be in line
with the new scoping rules. This resolves some unlikely bugs in edge
cases. This also introduces a new internal ``With`` node that can be
used by extensions.

2.9.2

-------------

Released 2017-01-08

- Fixed a regression that caused for loops to not be able to use the
same variable for the target as well as source iterator.
:issue:`640`
- Add support for a previously unknown behavior of macros. It used to
be possible in some circumstances to explicitly provide a caller
argument to macros. While badly buggy and unintended it turns out
that this is a common case that gets copy pasted around. To not
completely break backwards compatibility with the most common cases
it's now possible to provide an explicit keyword argument for caller
if it's given an explicit default. :issue:`642`

Page 3 of 8

© 2024 Safety CLI Cybersecurity Inc. All Rights Reserved.