2469 Commits

Author SHA1 Message Date
David Lord
b98182fc37
mention jinja in deprecation message 2021-04-15 15:32:57 -07:00
David Lord
f04bde8334
Merge pull request #1398 from pallets/docs-filter-anchor
unique links for filters, tests, globals
2021-04-13 10:41:17 -07:00
David Lord
f61cc84dba
unique links for filters, tests, globals 2021-04-13 10:36:11 -07:00
David Lord
414a8c4365
Merge pull request #1394 from pallets/pre-commit-ci-update-config
[pre-commit.ci] pre-commit autoupdate
2021-04-12 10:24:41 -07:00
pre-commit-ci[bot]
d43430791f
[pre-commit.ci] pre-commit autoupdate 2021-04-12 17:12:51 +00:00
David Lord
06230b0022
Merge pull request #1393 from pallets/deprecate-legacy-resolve
deprecate legacy resolve mode
2021-04-11 23:58:46 -07:00
David Lord
912e59d51f
deprecate legacy resolve mode 2021-04-11 23:53:59 -07:00
David Lord
9d4689b04d
Merge pull request #1392 from pallets/inline-async
async support doesn't require patching
2021-04-11 18:55:36 -07:00
David Lord
1932ce3dc4
async support doesn't require patching 2021-04-10 16:12:25 -07:00
David Lord
a9b06f4bd2
Merge pull request #1391 from pallets/markupsafe-imports
Markup and escape should be imported from markupsafe
2021-04-10 10:24:58 -07:00
David Lord
aafe94d97a
Markup and escape should be imported from markupsafe 2021-04-10 10:22:24 -07:00
David Lord
39846a887b
Merge pull request #1389 from pallets/unify-decorators
unify/rename context function decorators
2021-04-10 10:19:30 -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
David Lord
c8db6c6313
extract common code for import/from nodes 2021-04-10 08:58:43 -07:00
David Lord
94b381da23
Merge pull request #1152 from angelafrentz/refactor_ternary_statement_compiler 2021-04-09 15:33:14 -07:00
angelafrentz
8c97ae57d1
refactor compiler environment.is_async checks 2021-04-09 15:27:58 -07:00
dependabot-preview[bot]
841fb295eb
Merge pull request #1387 from pallets/dependabot/pip/urllib3-1.26.4 2021-04-06 18:03:18 +00:00
dependabot-preview[bot]
20d4766b27
[Security] Bump urllib3 from 1.26.3 to 1.26.4
Bumps [urllib3](https://github.com/urllib3/urllib3) from 1.26.3 to 1.26.4. **This update includes a security fix.**
- [Release notes](https://github.com/urllib3/urllib3/releases)
- [Changelog](https://github.com/urllib3/urllib3/blob/main/CHANGES.rst)
- [Commits](https://github.com/urllib3/urllib3/compare/1.26.3...1.26.4)

Signed-off-by: dependabot-preview[bot] <support@dependabot.com>
2021-04-06 18:01:52 +00:00
David Lord
c752dc8183
Merge pull request #1360 from lisongmin/add-default-value-to-groupby
Ability to set default value in groupby filter
2021-04-05 14:44:37 -07:00
lisongmin
34fbec9a72
add default parameter to groupby 2021-04-05 14:42:34 -07:00
David Lord
4a941cab0d
Merge pull request #1367 from mvolfik/docs-fix
line statements have no default
2021-04-05 14:27:12 -07:00
Matěj Volf
671cbd73fe
Fix incorrect docs - line statements have no default 2021-04-05 14:26:14 -07:00
David Lord
eaf0cca37b
Merge pull request #1364 from Dreamsorcerer/patch-2
Fix map documentation
2021-04-05 14:23:33 -07:00
Sam Bull
da48bb0d20
Fix map documentation 2021-04-05 14:19:33 -07:00
David Lord
e45eabccf0
Merge pull request #1236 from sixtyfathoms/fix/issue-1184
Update wording on dictionary default ordering
2021-04-05 14:18:56 -07:00
jeff
0fa20045b0
update wording on dictionary default ordering 2021-04-05 14:17:01 -07:00
David Lord
851f7aff57
Merge pull request #1226 from geographika/patch-1
Add symbol names for tilde and pipe
2021-04-05 14:08:20 -07:00
Seth G
1fa864a561
add symbol names for tilde and pipe operators 2021-04-05 14:06:35 -07:00
David Lord
4abb2a0739
Merge pull request #1366 from mvolfik/fix-unicode-newlines
Fix unicode newlines
2021-04-05 11:50:38 -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
David Lord
59de6fbde9
Merge pull request #1363 from remidebette/add-native-async-support
Add async support to NativeEnvironment
2021-04-05 11:38:54 -07:00
remidebette
3642ae7fef
NativeEnvironment supports async mode 2021-04-05 11:36:54 -07:00
David Lord
06c7c6fee1
Merge pull request #1294 from Jafnee/chainableundefined-aiter-bug
Add __aiter__ to Undefined
2021-04-05 10:53:57 -07:00
Jafnee
3242428c52
add Undefined.__aiter__ 2021-04-05 10:51:29 -07:00
David Lord
139c3eee81
Merge pull request #1204 from dparker2/undefined-contains
Raise UndefinedError from Undefined.__contains__
2021-04-05 10:46:24 -07:00
David Parker
609bcb0831
Undefined.__contains__ raises UndefinedError 2021-04-05 10:44:31 -07:00
David Lord
fd001b216a
Merge pull request #1171 from amykyta3/feature/base-integer-literals
Add support for hex, octal, and binary integer literals
2021-04-05 10:40:02 -07:00
Alex Mykyta
2e0a3da2bc
parse hex, octal, and binary integer literals 2021-04-05 10:35:57 -07:00
David Lord
1eb871fdc3
Merge pull request #1385 from pallets/pre-commit-ci-update-config
[pre-commit.ci] pre-commit autoupdate
2021-04-05 10:24:35 -07:00
pre-commit-ci[bot]
ea1ccb670c
[pre-commit.ci] pre-commit autoupdate 2021-04-05 17:10:51 +00:00
David Lord
1b874db337
Merge pull request #1167 from LarsKollstedt/allow_indent_with_generic_char
indent filter can indent with arbitrary characters
2021-04-05 09:53:29 -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
David Lord
7bea9193f4
Merge pull request #1384 from pallets/typing-filters-tests
add type annotations to filters and tests
2021-04-05 09:33:52 -07:00
David Lord
f0a9f319b7
add type annotations to filters and tests 2021-04-05 09:25:26 -07:00
Adrian
43d4228930
Merge pull request #1126 from imomaliev/pgettext-support
add pgettext to InternationalizationExtension
2021-04-05 13:57:00 +02:00
Sardorbek Imomaliev
3fba898098
add pgettext and npgettext 2021-04-05 04:45:05 -07:00
David Lord
beabf304b0
Merge pull request #1383 from pallets/test-decorators
add 'is filter' and 'is test' tests
2021-04-04 17:39:15 -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
David Lord
af5d80e999
Merge pull request #1248 from MLH-Fellowship/test-for-filter
allow optional use of a filter based on its existence
2021-04-04 10:20:49 -07:00
Amy
ebf0e2dfda allow optional use of filter based on existence 2021-04-04 13:09:31 -04:00