Skip to content
This repository was archived by the owner on Aug 17, 2023. It is now read-only.

Using several "with" statements on the same block level does not render the closing tag at the correct spot #23

Closed
Kangaroux opened this issue Nov 15, 2016 · 1 comment
Assignees
Labels

Comments

@Kangaroux
Copy link

Copying this from the old repo: jessemiller#170


Example:

- with some_context
  ...
- with some_other_context
  ...

Gets compiled to:

{% with some_context %}
  ...
{% with some_other_context %}
  ...
{% endwith %}
{% endwith %}

Should be:

{% with some_context %}
  ...
{% endwith %}
{% with some_other_context %}
  ...
{% endwith %}
@Kangaroux Kangaroux changed the title Using a "with" statement does not close the tag properly Using several "with" statements on the same block level does not render the closing tag at the correct spot Nov 21, 2016
@Kangaroux
Copy link
Author

You can use this test (test/test_compiler.py):

def test_django_tag_with(self):
        # with tag
        self._test('- with context\n   %p hello\n- with other_context\n   %p goodbye',
                   '{% with context %}\n   <p>hello</p>\n{% endwith %}{% with other_context %}\n   <p>goodbye</p>\n{% endwith %}')

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Projects
None yet
Development

No branches or pull requests

2 participants