From 512ecef899b0800b748a6cc3607fe28d35cc49ca Mon Sep 17 00:00:00 2001 From: David Molineus Date: Mon, 20 Feb 2023 12:03:20 +0100 Subject: [PATCH] Fix removal of template debug markers (#114) --- src/MapProvider.php | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) 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 );