Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Support filters in set block #489

Merged
merged 1 commit into from Oct 31, 2017

Conversation

ThiefMaster
Copy link
Member

As suggested in #486, this adds support for filters in set blocks:

{% set foo | somefilter %}
    this is a test
{% endset %}

CHANGES Outdated
@@ -43,6 +43,7 @@ Version 2.9
- The `with` and `autoescape` tags are now built-in.
- Added the new `select_autoescape` function which helps configuring better
autoescaping easier.
- Added filter support to the block ``set`` tag.

This comment was marked as off-topic.

This comment was marked as off-topic.

self.visit_Filter(node.filter, block_frame)
else:
self.write('concat(%s)' % block_frame.buffer)
self.write(')')

This comment was marked as off-topic.

This comment was marked as off-topic.

This comment was marked as off-topic.

- e.g {% set foo | trim %}...{% endset %}
- closes pallets#486
@ThiefMaster ThiefMaster merged commit 072cdf9 into pallets:master Oct 31, 2017
@ThiefMaster ThiefMaster deleted the set-block-filters branch October 31, 2017 22:34
wmfgerrit pushed a commit to wikimedia/operations-docker-images-docker-pkg-deploy that referenced this pull request Dec 19, 2017
So we can benefit from filters in set blocks. Example:

    {% set foo | somefilter %}
        this is a test
    {% endset %}

pallets/jinja#489

Change-Id: I2f8833291af3e672494f6bb95a81486f8914e133
@github-actions github-actions bot locked as resolved and limited conversation to collaborators Nov 13, 2020
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants