diff --git a/src/MapProvider.php b/src/MapProvider.php index 8ed75df..2158a59 100644 --- a/src/MapProvider.php +++ b/src/MapProvider.php @@ -31,6 +31,7 @@ use Netzmacht\LeafletPHP\Value\GeoJson\FeatureCollection; use Symfony\Component\Cache\CacheItem; use Symfony\Contracts\EventDispatcher\EventDispatcherInterface as EventDispatcher; use Symfony\Contracts\Cache\CacheInterface as Cache; +use function dd; /** * Class MapProvider. @@ -399,8 +400,8 @@ class MapProvider $content = $this->templateRenderer->render($templateReference, $parameters); $content = preg_replace( - ['/^\n*/', '/\n*$/'], - '', + ['/^(\s*)\n*/', '/\n*$/'], + ['$1', ''], $content );