mirror of
https://github.com/twigphp/Twig.git
synced 2026-09-16 12:26:30 +00:00
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:
@@ -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));
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
Reference in New Issue
Block a user