Commit Graph

140 Commits

Author SHA1 Message Date
David Lord
cdbda09e44
Merge branch '3.0.x' 2021-05-18 13:40:36 -07:00
David Lord
738644d816
start version 3.0.2.dev0 2021-05-18 13:39:52 -07:00
David Lord
4d23bfb317
release version 3.0.1 2021-05-18 13:35:09 -07:00
David Lord
7d0b7accff
use asyncio.run 2021-05-18 13:22:46 -07:00
David Lord
ab7840328f
Merge pull request #1439 from pallets/deprecated-markup
fix deprecated `Markup` subclass
2021-05-17 06:45:26 -07:00
David Lord
f562a4fdea
fix deprecated Markup subclass 2021-05-17 06:41:42 -07:00
David Lord
55848d36c0
Merge branch '3.0.x' 2021-05-13 18:01:18 -07:00
David Lord
b4d31e7b8d
show context for deprecated extensions 2021-05-13 17:48:19 -07:00
David Lord
a2e83d07a3
Merge pull request #1434 from pallets/update-typing
Update typing
2021-05-13 17:30:40 -07:00
David Lord
9f34d2ac87
fix typing that wasn't available in Python 3.6.0 2021-05-13 17:25:08 -07:00
David Lord
db5fb7971f
mark top-level names as exported 2021-05-13 17:19:23 -07:00
David Lord
1c4066a4fa
Merge remote-tracking branch 'origin/3.0.x' 2021-05-11 14:23:25 -07:00
David Lord
e2f673e604
update markupsafe minimum version 2021-05-11 14:21:06 -07:00
David Lord
c2d8b9551f
start version 3.1.0.dev0 2021-05-11 14:10:43 -07:00
David Lord
058c06f24d
start version 3.0.1.dev0 2021-05-11 14:10:02 -07:00
David Lord
b15fd1c94c
release version 3.0.0 2021-05-11 14:02:01 -07:00
David Lord
be15556dba
add type annotations 2021-05-08 13:03:15 -07:00
David Lord
912e59d51f
deprecate legacy resolve mode 2021-04-11 23:53:59 -07:00
David Lord
1932ce3dc4
async support doesn't require patching 2021-04-10 16:12:25 -07:00
David Lord
788d8bc172
unify/rename filter and function decorators
Use pass_context instead of contextfilter and contextfunction, etc.
2021-04-10 10:14:42 -07:00
lisongmin
34fbec9a72
add default parameter to groupby 2021-04-05 14:42:34 -07:00
Matěj Volf
9dae67bcc8
Split lines in lexer only by \r\n, \r and \n
Python str.splitlines() splits by more characters[1], which, however,
causes problems when keeping these special characters in processed
templates is desirable, i.e. these bug reports: #769, #952, #1313.

The keep_trailing_newlines logic is reworked because splitlines()
removes them already (so they had to be added), while re.split doesn't
so they have to be removed.

[1] https://docs.python.org/3/library/stdtypes.html#str.splitlines
2021-04-05 11:46:36 -07:00
remidebette
3642ae7fef
NativeEnvironment supports async mode 2021-04-05 11:36:54 -07:00
Jafnee
3242428c52
add Undefined.__aiter__ 2021-04-05 10:51:29 -07:00
David Parker
609bcb0831
Undefined.__contains__ raises UndefinedError 2021-04-05 10:44:31 -07:00
Alex Mykyta
2e0a3da2bc
parse hex, octal, and binary integer literals 2021-04-05 10:35:57 -07:00
Lars Kollstedt
8016b5f139
filters.py: do_indent: ident filter can indent with arbitrary characters
Allow indention with generic characters, e.g. Tabs.

Implemenented the behavior requested in
https://github.com/pallets/jinja/pull/1167#issuecomment-612644701

The width param can be string or int, if it is string it's the raw
indention e.g. "\t". If it's int it's the number of spaces. In other
cases an FilterArgumentError is raised, to avoid confusion.
2021-04-05 09:50:45 -07:00
Sardorbek Imomaliev
3fba898098
add pgettext and npgettext 2021-04-05 04:45:05 -07:00
David Lord
6c733602ac
add 'is filter' and 'is test' tests
This required allowing tests to be decorated with '@environmentfilter'.
Tests are essentially the same as filters now, the node, compiler, and
environment have been refactored to extract common behavior.
2021-04-04 17:20:23 -07:00
Amy
ebf0e2dfda allow optional use of filter based on existence 2021-04-04 13:09:31 -04:00
David Lord
38e45fead3
more detailed docs about globals 2021-03-31 16:09:51 -07:00
Amy
49d5f9788c fix bug with cached templates not using new globals 2021-03-30 01:43:51 -04:00
Amy
f524bcce0c track local loop/block vars for contextfunctions 2021-03-26 16:45:25 -04:00
BALaka-18
73a94e00d4
map filter can use False as default 2021-02-24 17:16:01 -08:00
David Lord
076d380361
Merge branch '2.11.x' 2021-01-31 08:48:44 -08:00
David Lord
cf215390d4
release version 2.11.3 2021-01-31 08:44:37 -08:00
David Lord
ef658dc3b6
speed up urlize matching 2021-01-31 08:02:04 -08:00
David Lord
1aa979c545
refactor urlize function
don't try other url types if one already matched
no-op function if trim is not enabled
avoid backtracking when matching trailing punctuation
match head and tail punctuation separately
don't scan for unbalanced parentheses more than necessary
ensure email domain starts and ends with a word character
2021-01-30 22:20:17 -08:00
David Lord
be83e7e06c
update urlize docs, clean up code
move regexes near implementation
commented verbose regex for http pattern
renamed extra_uri_schemes to extra_schemes
2021-01-30 13:38:56 -08:00
David Lord
c3b34a06f3
update docs about required blocks (#1340) 2021-01-30 05:47:23 -08:00
FawziyahAlebiosu
1843d6d411 deprecate 'with' and 'autoescape' extensions 2021-01-29 16:56:47 -05:00
Amy
8da77f9753 add required attribute to blocks
required blocks must be overridden at some point, although not
necessarily by the direct child template
2021-01-29 10:28:39 -05:00
Martin Krizek
bd8bad37d1 native_concat: pass only strings to literal_eval
If there is only single node and it is not a string, there is no point
in passing it into ``literal_eval``, just return it immediately.

One of the examples where passing a non-string node into
``literal_eval`` would actually cause problems is when the node is
``Undefined``. On Python 3.10 this would cause ``UndefinedError``
instead of just ``Undefined`` being returned.

Fixes #1335
2021-01-28 12:13:30 +01:00
Richard Gibson
e1d0131a7f
detect custom async filters in as_const 2020-10-31 19:07:26 -07:00
Amy
6b0122768f
ignore trim_blocks using '+%}' 2020-06-22 10:21:47 -07:00
Amy
cc792d8c91
imported templates can see the current globals
_get_default_module takes an optional context to indicate that the
template is imported. If there are differences between the environment
and rendered template globals, a new module is used for the imported
template.
2020-06-22 09:56:10 -07:00
David Lord
da812816ff
Merge branch '2.11.x' 2020-04-13 09:26:39 -07:00
David Lord
9ec465baef
fix changelog header 2020-04-13 09:20:59 -07:00
David Lord
737a4cd41d
release version 2.11.2 2020-04-13 09:12:19 -07:00
David Lord
f75cb42e4f
native only evals at end of render
Co-authored-by: Martin Krizek <mkrizek@redhat.com>
2020-04-13 08:51:38 -07:00