пример фильтра nunjucks (не Filters) - PullRequest
0 голосов
/ 15 апреля 2019

Существует два вида фильтров в nunjucks.

1, Фильтры http://mozilla.github.io/nunjucks/templating.html#filters

пример

{{ foo | title }}
{{ foo | join(",") }}
{{ foo | replace("foo", "bar") | capitalize }}

2, фильтр http://mozilla.github.io/nunjucks/templating.html#filter

сказано:

A filter block allows you to call a filter with the contents of the block. 
Instead passing a value with the | syntax, the render contents from the 
block will be passed.

пример

{% filter title %}
may the force be with you
{% endfilter %}
{% filter replace("force", "forth") %}
may the force be with you
{% endfilter %}

Я не могу понять второй фильтр из приведенного выше примера.Кто-нибудь может привести полный пример?

...