mirror of
https://github.com/twigphp/Twig.git
synced 2026-09-17 21:07:18 +00:00
Adding additional test suggested by nikic.
This commit is contained in:
@@ -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))) {
|
||||
|
||||
@@ -28,6 +28,8 @@ Whitespace trimming on tags.
|
||||
{%- endif -%}
|
||||
</ul>
|
||||
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
|
||||
<ul>
|
||||
<li>both</li>
|
||||
</ul>
|
||||
after
|
||||
after
|
||||
15
|
||||
18
|
||||
|
||||
Reference in New Issue
Block a user