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

Addresses 914; capture blocks in macros now write to temporary output buffer #990

Merged
merged 1 commit into from
May 21, 2017

Conversation

noahlange
Copy link
Contributor

@noahlange noahlange commented May 12, 2017

Summary

Proposed change: Fixes a bug that led the capture block compiler to write to the main buffer instead of the temporary one. Previously, the following code would (incorrectly) write "foobar".

{%- macro foo(bar) -%}
  {%- set test -%}
    foo
  {%- endset -%}
  {{ bar }}{{ test }}
{%- endmacro -%}
{{ foo("bar") }}

Now it writes "barfoo."

Closes #914.

Checklist

I've completed the checklist below to ensure I didn't forget anything.
( I accidentally hit enter before finishing the checklist.)

@noahlange noahlange changed the title Addresses 914; capture blocks in macros now write to proper tmp buffer. Addresses 914; capture blocks in macros now write to temporary output buffer May 12, 2017
@noahlange
Copy link
Contributor Author

This also appears to solve #972.

@fdintino
Copy link
Collaborator

This looks great, thanks!

@fdintino fdintino merged commit 5312e66 into mozilla:master May 21, 2017
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Set blocks prints its content
2 participants