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
Merged

Conversation

@ThiefMaster
Copy link
Member

@ThiefMaster 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 %}
@ThiefMaster ThiefMaster force-pushed the ThiefMaster:set-block-filters branch 2 times, most recently from 028db2d to 14cdc77 Sep 11, 2015
@ThiefMaster ThiefMaster force-pushed the ThiefMaster:set-block-filters branch 4 times, most recently from e2da2f1 to 8158949 Jan 6, 2017
@ThiefMaster ThiefMaster requested a review from mitsuhiko Jan 7, 2017
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 has been minimized.

@mitsuhiko

mitsuhiko Jan 7, 2017
Member

This should go into 2.10

This comment has been minimized.

@ThiefMaster

ThiefMaster Jan 7, 2017
Author Member

ah, didn't notice you released 2.9 the last time i rebased

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.

This comment has been minimized.

@ThiefMaster

ThiefMaster Jan 7, 2017
Author Member

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

This comment has been minimized.

@ThiefMaster ThiefMaster force-pushed the ThiefMaster:set-block-filters branch 2 times, most recently from 1a72eac to e3f7993 Jan 7, 2017
@ThiefMaster ThiefMaster force-pushed the ThiefMaster:set-block-filters branch from e3f7993 to 6b66942 Apr 5, 2017
@ThiefMaster ThiefMaster force-pushed the ThiefMaster:set-block-filters branch from 6b66942 to 0849f32 Jun 24, 2017
@ThiefMaster ThiefMaster force-pushed the ThiefMaster:set-block-filters branch 2 times, most recently from e59142e to c292e5f Aug 22, 2017
@ThiefMaster ThiefMaster force-pushed the ThiefMaster:set-block-filters branch from c292e5f to e77f88b Oct 31, 2017
- e.g {% set foo | trim %}...{% endset %}
- closes #486
@ThiefMaster ThiefMaster force-pushed the ThiefMaster:set-block-filters branch from e77f88b to 072cdf9 Oct 31, 2017
@ThiefMaster ThiefMaster merged commit 072cdf9 into pallets:master Oct 31, 2017
1 check passed
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
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
Linked issues

Successfully merging this pull request may close these issues.

None yet

2 participants
You can’t perform that action at this time.