symfony/symfony — pull request #2967 by FabienPennequin (2011-12-26 19:30:26+00:00)
Title: [Twig] Fix TransNode with Twig 1.5

Bug fix: yes
Feature addition: no
Backwards compatibility break: no
Symfony2 tests pass: yes
Fixes the following tickets: -
Todo: -

In some cases, Tag Twig transchoice doesn't work with Twig 1.5. Same code with Twig 1.4 works fine.

The bug occurs when the tag `transchoice` uses multiple lines.

Example:

This code will work with Twig 1.4 and 1.5

{% transchoice count with {'%name%': 'Symfony2'} %}{0} There is no apples|{1} There is one apple|]1,Inf] There is %count% apples (%name%){% endtranschoice %}

but the following code doesn't work with v1.5

{% transchoice count with {'%name%': 'Symfony2'} %}
{0} There is no apples|{1} There is one apple|]1,Inf] There is %count% apples (%name%)
{% endtranschoice %}