bug #2899 Fixed spaceless filter (tifabien)

This PR was merged into the 1.x branch.

Discussion
----------

Fixed spaceless filter

As now the `spaceless` tag is deprecated, I tried to replace it by the new `spaceless` filter instead but it broke my application. Actually there is a difference between the tag and the filter. Spaceless tag trim also whistespace (or line feed).

I propose to do the same thing on the new filter.

Commits
-------

3412d1a5 Fixed spaceless filter
This commit is contained in:
Fabien Potencier
2019-03-14 14:57:20 +01:00
+1 -1
View File
@@ -997,7 +997,7 @@ function twig_trim_filter($string, $characterMask = null, $side = 'both')
*/
function twig_spaceless($content)
{
return preg_replace('/>\s+</', '><', $content);
return trim(preg_replace('/>\s+</', '><', $content));
}
/**