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

Projects
None yet
2 participants
@ThiefMaster
Member

ThiefMaster commented Sep 11, 2015

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

{% set foo | somefilter %}
    this is a test
{% endset %}
Show outdated Hide outdated CHANGES
self.visit_Filter(node.filter, block_frame)
else:
self.write('concat(%s)' % block_frame.buffer)
self.write(')')

This comment has been minimized.

@mitsuhiko

mitsuhiko Jan 7, 2017

Member

Not sure if this properly handles the new identifier tracking. This needs some tests what happens if you combine it with set and referring to variables in weird ways.

@mitsuhiko

mitsuhiko Jan 7, 2017

Member

Not sure if this properly handles the new identifier tracking. This needs some tests what happens if you combine it with set and referring to variables in weird ways.

This comment has been minimized.

@ThiefMaster

ThiefMaster Jan 7, 2017

Member

Do you mean something like what I added in the latest commit?

@ThiefMaster

ThiefMaster Jan 7, 2017

Member

Do you mean something like what I added in the latest commit?

This comment has been minimized.

@ThiefMaster
@ThiefMaster
Support filters in set block
- e.g {% set foo | trim %}...{% endset %}
- closes #486

@ThiefMaster ThiefMaster merged commit 072cdf9 into pallets:master Oct 31, 2017

1 check passed

continuous-integration/travis-ci/pr The Travis CI build passed
Details

@ThiefMaster ThiefMaster deleted the ThiefMaster:set-block-filters branch Oct 31, 2017

wmfgerrit pushed a commit to wikimedia/operations-docker-images-docker-pkg-deploy that referenced this pull request Dec 19, 2017

Bump Jinja2 from 2.9.6 to 2.10
So we can benefit from filters in set blocks. Example:

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

pallets/jinja#489

Change-Id: I2f8833291af3e672494f6bb95a81486f8914e133
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment