使用|
對傳入值進行過濾,多個過濾器可以鏈式連接.
{{ name|striptags|title }}
相當於 (title(striptags(name)))
也可調用相應的方法過濾
{{ listx|join(', ') }}
相當於 str.join(', ', listx)
內置的過濾器參考:
https://jinja.palletsprojects.com/en/master/templates/#list-of-builtin-filters
https://jinja.palletsprojects.com/en/master/templates/#id11
{% filter upper %}
This text becomes uppercase
{% endfilter %}