'upper' => new Twig_Filter_Function('strtoupper'),
'lower' => new Twig_Filter_Function('strtolower'),
'striptags' => new Twig_Filter_Function('strip_tags'),
+ 'trim' => new Twig_Filter_Function('trim'),
'nl2br' => new Twig_Filter_Function('nl2br', array('pre_escape' => 'html', 'is_safe' => array('html'))),
// array helpers
--- /dev/null
+--TEST--
+"trim" filter
+--TEMPLATE--
+{{ " I like Twig. "|trim }}
+{{ text|trim }}
+{{ " foo/"|trim("/") }}
+--DATA--
+return array('text' => " If you have some <strong>HTML</strong> it will be escaped. ")
+--EXPECT--
+I like Twig.
+If you have some <strong>HTML</strong> it will be escaped.
+ foo