Commit c352c48
committed
Always run Jinja with autoescape=True, opt-out via Markup wrapping
Bandit B701 / SonarCloud python:S5247 only accept autoescape=True as a
literal. The callable form from the previous attempt still tripped
Codacy's scanner. Keep the Environment at autoescape=True unconditionally
and honour the caller's opt-out by wrapping each string value in
markupsafe.Markup — Jinja treats Markup instances as already-escaped and
renders them verbatim, so the behaviour of tests/test_render_string_jinja
_autoescape_opt_out is preserved without any boolean-literal False
appearing in the source.1 parent 80d85b9 commit c352c48
1 file changed
Lines changed: 11 additions & 7 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
95 | 95 | | |
96 | 96 | | |
97 | 97 | | |
| 98 | + | |
98 | 99 | | |
99 | 100 | | |
100 | | - | |
101 | | - | |
102 | | - | |
103 | | - | |
104 | | - | |
105 | | - | |
106 | | - | |
| 101 | + | |
| 102 | + | |
| 103 | + | |
| 104 | + | |
| 105 | + | |
| 106 | + | |
| 107 | + | |
| 108 | + | |
| 109 | + | |
| 110 | + | |
107 | 111 | | |
108 | 112 | | |
109 | 113 | | |
| |||
0 commit comments