merged branch Seldaek/markup (PR #638)
authorFabien Potencier <fabien.potencier@gmail.com>
Sat, 18 Feb 2012 08:54:30 +0000 (09:54 +0100)
committerFabien Potencier <fabien.potencier@gmail.com>
Sat, 18 Feb 2012 08:54:30 +0000 (09:54 +0100)
commitc75d5952e357f347d2056d8fd2685f491eaab9cd
tree3bed17ff38cca61b94e901bcc10b99530d81b08e
parent4b1a8e2798cac8f1445ddf530fd3acf1f1ef7b85
parente4590d0cd8cf2d8cca4b71cce11e335d4f6a753b
merged branch Seldaek/markup (PR #638)

Commits
-------

e4590d0 Avoid creating unnecessary Twig_Markup instances, allows testing for falsiness of empty output

Discussion
----------

Avoid creating unnecessary Twig_Markup instances

This allows testing for falsiness of an empty output:

```jinja
{% set foo %}{% block lala %}{% endblock %}{% endset %}

{% if foo %}
   some output with {{ foo }}
{% endif %}
```

Currently this requires `{% if foo|length %}` since the set tag will always return a Twig_Markup.