Commit Graph

2778 Commits

Author SHA1 Message Date
David Lord
b4ffc8ff29
release version 3.1.5 (#2066) 2024-12-21 10:30:50 -08:00
David Lord
877f6e51be
release version 3.1.5 2024-12-21 10:16:13 -08:00
David Lord
8d58859265
remove test pypi 2024-12-21 10:14:49 -08:00
David Lord
eda8fe86fd
update dev dependencies 2024-12-21 10:14:25 -08:00
David Lord
c8fdce1e03
Fix bug involving calling set on a template parameter within all branches of an if block (#1665) 2024-12-21 09:46:55 -08:00
Kevin Brown-Silva
66587ce989
Fix bug where set would sometimes fail within if
There was a bug that came as the result of an early optimization done
within ID tracking that caused loading parameters to fail in a very
specific and rare edge case. That edge case only occurred when the
parameter was being set within all 3 standard branches of an if block,
since the optimization would assume that the parameter was never being
referenced and was only ever being set. This would cause the variable to
be set to undefined.

The fix for this was to remove the optimization and still continue to
load in the parameter even if it is set in all 3 branches.
2024-12-21 09:40:06 -08:00
David Lord
fbc3a696c7
Add support for namespaces in tuple parsing (#1664) 2024-12-20 14:52:51 -08:00
David Lord
b8f4831d41
more comments about nsref assignment
only emit nsref instance check once per ref name
refactor primary name parsing a bit
2024-12-20 14:49:58 -08:00
Kevin Brown-Silva
ee832194cd
Add support for namespaces in tuple assignment
This fixes a bug that existed because namespaces within `{% set %}`
were treated as a special case. This special case had the side-effect
of bypassing the code which allows for tuples to be assigned to.

The solution was to make tuple handling (and by extension, primary token
handling) aware of namespaces so that namespace tokens can be handled
appropriately. This is handled in a backwards-compatible way which
ensures that we do not try to parse namespace tokens when we otherwise
would be expecting to parse out name tokens with attributes.

Namespace instance checks are moved earlier, and deduplicated, so that
all checks are done before the assignment. Otherwise, the check could be
emitted in the middle of the tuple.
2024-12-20 14:09:40 -08:00
David Lord
1d55cddbb2
Triple quotes in docs (#2064) 2024-12-20 08:31:34 -08:00
David Lord
8a8eafc6b9
edit block assignment section 2024-12-20 08:29:04 -08:00
ratchek
d6998ab74e
Make ease of use update to template documentation
Add the phrases 'multiline comment' and 'triple quotes' to docs
in the templates/#block-assignments section. This allows for new
users to find this alternative easily.
2024-12-20 08:19:26 -08:00
David Lord
e7cb37de59
document SandboxedNativeEnvironment pattern (#2063) 2024-12-20 07:58:33 -08:00
David Lord
ae68c961dc
document SandboxedNativeEnvironment pattern 2024-12-20 07:57:11 -08:00
David Lord
028f61da7b
Pass context to test when using select (#1762) 2024-12-19 20:49:09 -08:00
Rens Groothuijsen
d05bd3858c
Pass context when using select 2024-12-19 20:47:24 -08:00
David Lord
7a41ddb915
don't apply urlize to @a@b (#2062) 2024-12-19 20:41:36 -08:00
наб
0cd6948192
don't apply urlize to @a@b 2024-12-19 20:37:58 -08:00
David Lord
106d61cba5
improve annotations for methods returning copies (#1880) 2024-12-19 20:28:13 -08:00
Victor Westerhuis
ded9915fc5
improve annotations for methods returning copies 2024-12-19 20:26:44 -08:00
David Lord
53c75915c9
Improve the PackageLoader error message (#1706) 2024-12-19 20:17:25 -08:00
David Lord
aaa083d265
separate messages, add test 2024-12-19 20:15:10 -08:00
Lily Foote
f54fa113d3
Improve the PackageLoader error message
This exception is raised when the `package_path` directory (default "templates") is not
found, so explain this.
2024-12-19 20:02:32 -08:00
David Lord
58a358f092
FileSystemLoader include paths in error (#1663) 2024-12-19 19:38:22 -08:00
David Lord
227edfd372
clean up message, add test 2024-12-19 19:34:34 -08:00
Yourun-Proger
ed5f76206a
FileSystemLoader includes search paths in error 2024-12-19 19:33:29 -08:00
David Lord
b4b28ec01c
fix default for Environment.overlay(enable_async) (#2061) 2024-12-19 18:23:52 -08:00
SamyCookie
e45bc745a7
Bugfix: wrong default argument for Environment.overlay(enable_async) parameter 2024-12-19 18:22:32 -08:00
David Lord
767b236176
fix f-string syntax error in code generation (#1852) 2024-12-19 18:10:28 -08:00
Sigurd Spieckermann
56a724644b
fix f-string syntax error in code generation 2024-12-19 18:08:42 -08:00
David Lord
48b0687e05
Merge commit from fork
fix format string vulnerability
2024-12-19 14:33:08 -08:00
Lydxn
91a972f580
sandbox indirect calls to str.format 2024-12-19 12:34:27 -08:00
David Lord
0871c71d01
rearrange change entry 2024-12-19 12:07:14 -08:00
David Lord
91e3521173
sandbox disallows clear and pop on mutable sequence (#2033) 2024-12-19 08:36:07 -08:00
Dylan Scott
b512058270
sandbox disallows clear and pop on mutable sequence 2024-12-19 08:33:38 -08:00
David Lord
1dc04bccf9
Fix pickle/copy support for the missing singleton (#2029) 2024-12-19 08:20:38 -08:00
Matt Clay
7232b82462
Fix pickle/copy support for the missing singleton 2024-12-19 08:19:07 -08:00
David Lord
ba8847a466
Preserve __slots__ metadata on Undefined types (#2026) 2024-12-19 08:14:53 -08:00
Matt Davis
d4fb0e8c40
preserve __slots__ on Undefined classes 2024-12-19 08:11:49 -08:00
David Lord
39d9ffff1f
Make compiled output deterministic for tuple unpacking in set tag (#2022) 2024-12-19 08:05:48 -08:00
Anentropic
4936e4d482
make tuple unpacking deterministic in compiler 2024-12-19 08:02:33 -08:00
David Lord
3ef3ba885b
fix how int filter handles scientific notation (#1984) 2024-12-19 07:59:45 -08:00
Felipe Moreno
2eb4542cba
int filter handles OverflowError to handle scientific notation 2024-12-19 07:58:25 -08:00
David Lord
20be10e566
make unique filter async aware (#1782) 2024-12-19 07:26:24 -08:00
Mehdi ABAAKOUK
76af7110ea
make unique filter async-aware 2024-12-19 07:19:13 -08:00
David Lord
a4abbfd753
Use correct concat function for blocks evaluation (#1702) 2024-12-19 07:15:37 -08:00
Martin Krizek
d3a0b1a4ab
use env.concat when calling block reference 2024-12-19 07:12:43 -08:00
David Lord
791dd3b041
Simplify example for ModuleLoader (#1695) 2024-12-18 16:08:33 -08:00
Charles-Axel Dein
955d7daf3d
Simplify example for ModuleLoader
The `ModuleLoader` example seems copy pasted from `ChoiceLoader`. As a result it's not immediately clear how their API differ.
2024-12-18 10:07:18 -08:00
David Lord
13ce60bad8
fix Jinja syntax in example (#2056) 2024-12-18 09:47:24 -08:00