Environment level filters #1547
yoav-sentinel
started this conversation in
Show and tell
Replies: 1 comment 1 reply
-
I used a small unicode extension to apply a filter to everything some years ago, maybe it's a useful starting point for you: https://github.com/indico/indico/blob/v1.9.11.dev18/indico/web/flask/templating.py#L258 |
Beta Was this translation helpful? Give feedback.
1 reply
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
Hi
Is it possible to create jinja environment with default filters that will be added to all of the parameters automatically?
My specific use case is a requirement to add the following filter to all of my parameters (hundreds):
'| replace('|','\|')'
The pipe character needs to be escaped as I'm sending CEF messages where pipe is the delimiter unless escaped.
Another use case I had, is to add a default value to all parameters:
'| default("", true)'
It could be very useful to have environment level filters. For example:
Beta Was this translation helpful? Give feedback.
All reactions