]> git.ipfire.org Git - thirdparty/jinja.git/commitdiff
Merge branch 'master' into 557-map-default 985/head
authorDavid Lord <davidism@gmail.com>
Mon, 22 Jul 2019 16:45:20 +0000 (09:45 -0700)
committerDavid Lord <davidism@gmail.com>
Mon, 22 Jul 2019 17:30:10 +0000 (10:30 -0700)
1  2 
CHANGES.rst
jinja2/filters.py

diff --cc CHANGES.rst
index 5c55276ad87eaf21351ae495cf56c973cae97525,2b6b7632e260e6139f4edde14121bddf95034b1f..9a116531397a6bc7f340890296cb5546021242e2
@@@ -13,11 -13,25 +13,25 @@@ unrelease
    :class:`~environment.Environment` enables it, in order to avoid a
    slow initial import. (`#765`_)
  - Python 2.6 and 3.3 are not supported anymore.
- - The `map` filter in async mode now automatically awaits
- - Added `default` parameter for the `map` filter. (`#985`_)
+ - The ``map`` filter in async mode now automatically awaits
+ - Added a new ``ChainableUndefined`` class to support getitem
+   and getattr on an undefined object. (`#977`_)
+ - Allow ``{%+`` syntax (with NOP behavior) when
+   ``lstrip_blocks == False`` (`#748`_)
 -- Added ``default`` param for ``map`` filter. (`#557`_)
++- Added a ``default`` parameter for the ``map`` filter. (`#557`_)
+ .. _#557: https://github.com/pallets/jinja/issues/557
  .. _#765: https://github.com/pallets/jinja/issues/765
- .. _#985: https://github.com/pallets/jinja/pull/985
+ .. _#748: https://github.com/pallets/jinja/issues/748
+ .. _#977: https://github.com/pallets/jinja/issues/977
+ Version 2.10.2
+ --------------
+ _Unreleased_
+ -  Fix Python 3.7 deprecation warnings.
  
  
  Version 2.10.1
index 94751b8788d810b594e1b58bf18ef0ce79c6186d,da3e535cbdc31e22240f3c777d52b89e61351fc5..2b45b3cca2dbea0ad3c990d4fa42dc894209a413
@@@ -76,9 -71,8 +71,8 @@@ def make_attrgetter(environment, attrib
          for part in attribute:
              item = environment.getitem(item, part)
  
 -            if isinstance(item, Undefined) and default:
 +            if default and isinstance(item, Undefined):
                  item = default
-                 break
  
          if postprocess is not None:
              item = postprocess(item)
@@@ -970,7 -1012,7 +1012,7 @@@ def do_map(*args, **kwargs)
  
      .. sourcecode:: jinja
  
-         {{ users|map(attribute='username', default='Anonymous')|join(', ') }}
 -        Users on this page: {{ users|map(attribute="username", default="Anonymous")|join(", ") }}
++        {{ users|map(attribute="username", default="Anonymous")|join(", ") }}
  
      Alternatively you can let it invoke a filter by passing the name of the
      filter and the arguments afterwards.  A good example would be applying a