You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Providing a custom autoescape function is currently not possible, so
only HTML can be autoescaped for now (see #13). The filter `escape_md`,
is added to escape markdown, but it needs to be applied manually.
Copy file name to clipboardExpand all lines: README.md
+11Lines changed: 11 additions & 0 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -144,6 +144,16 @@ For more information on Jinja2 templates please refer to https://jinja.palletspr
144
144
For more information on URL path templates in aiohttp, see https://docs.aiohttp.org/en/stable/web_quickstart.html#variable-resources.
145
145
146
146
147
+
### Escaping
148
+
HTML-escaping is performed on all values automatically.
149
+
To prevent a value from being escaped, use the `safe` filter: `{{ foo | safe }}`
150
+
Refer to the Jinja2 docs for more information on autoescaping: https://jinja.palletsprojects.com/en/stable/templates/#working-with-automatic-escaping
151
+
152
+
> [!WARNING]
153
+
> While HTML is escaped automatically, markdown is not. It needs to be escaped manually via the `escape_md` filter: `{{ foo | escape_md }}`
154
+
> This behavior will eventually change when Jinja2 allows custom autoescape functions (see [#13](https://github.com/jkhsjdhjs/maubot-webhook/issues/13) for more information).
0 commit comments