N°8579 - Fix calls to Twig "spaceless" deprecated filter

This commit is contained in:
Stephen Abello
2025-09-04 14:57:24 +02:00
parent f5cce23bb4
commit a104310379

View File

@@ -154,6 +154,12 @@ class Extension
return twig_array_filter($oTwigEnv, $array, $arrow);
}, ['needs_environment' => true]);
// @since 3.3.0 N°8579
// Filter to remove spaces between HTML tags, overwrite the deprecated core "spaceless" filter
$aFilters[] = new TwigFilter('spaceless', function (?string $content) {
return trim(preg_replace('/>\s+</', '><', $content ?? ''));
}, ['is_safe' => ['html']]);
return $aFilters;
}