From: Mark Story Date: Wed, 6 Apr 2011 01:29:38 +0000 (-0400) Subject: Adding additional test suggested by nikic. X-Git-Url: http://git.silmor.de/gitweb/?a=commitdiff_plain;h=ec052b3ae0b7c361facd0a127afda705409b1871;p=konrad%2Ftwig.git Adding additional test suggested by nikic. --- diff --git a/lib/Twig/Lexer.php b/lib/Twig/Lexer.php index eb7c4c2..d03d14b 100644 --- a/lib/Twig/Lexer.php +++ b/lib/Twig/Lexer.php @@ -118,6 +118,7 @@ class Twig_Lexer implements Twig_LexerInterface $tmpPos = strpos($this->code, $this->options[$type][0], $this->cursor); if (false !== $tmpPos && $tmpPos < $pos) { $trimBlock = false; + $append = ''; $pos = $tmpPos; $token = $this->options[$type][0]; if (strpos($this->code, $this->options['whitespace_trim'], $pos) === ($pos + strlen($token))) { diff --git a/test/Twig/Tests/Fixtures/tags/trim_block.test b/test/Twig/Tests/Fixtures/tags/trim_block.test index 54cb727..8e31521 100644 --- a/test/Twig/Tests/Fixtures/tags/trim_block.test +++ b/test/Twig/Tests/Fixtures/tags/trim_block.test @@ -28,6 +28,8 @@ Whitespace trimming on tags. {%- endif -%} after +{{ 5 * '{#-'|length }} +{{ '{{-'|length * 5 + '{%-'|length }} --DATA-- return array('leading' => 'leading space', 'trailing' => 'trailing tabs', 'mixed' => 'mixed tags', 'both' => 'both') --EXPECT-- @@ -46,4 +48,6 @@ return array('leading' => 'leading space', 'trailing' => 'trailing tabs', 'mixed -after \ No newline at end of file +after +15 +18