Fix removal of template debug markers (#114)

This commit is contained in:
David Molineus
2023-02-20 12:03:20 +01:00
parent 06400f9d1a
commit 512ecef899

View File

@@ -31,6 +31,7 @@ use Netzmacht\LeafletPHP\Value\GeoJson\FeatureCollection;
use Symfony\Component\Cache\CacheItem; use Symfony\Component\Cache\CacheItem;
use Symfony\Contracts\EventDispatcher\EventDispatcherInterface as EventDispatcher; use Symfony\Contracts\EventDispatcher\EventDispatcherInterface as EventDispatcher;
use Symfony\Contracts\Cache\CacheInterface as Cache; use Symfony\Contracts\Cache\CacheInterface as Cache;
use function dd;
/** /**
* Class MapProvider. * Class MapProvider.
@@ -399,8 +400,8 @@ class MapProvider
$content = $this->templateRenderer->render($templateReference, $parameters); $content = $this->templateRenderer->render($templateReference, $parameters);
$content = preg_replace( $content = preg_replace(
['/^<!-- TEMPLATE (START): .+ -->\n*/', '/\n*<!-- TEMPLATE (END): .+ -->$/'], ['/^(\s*)<!-- TEMPLATE \(?START\)?: .+ -->\n*/', '/\n*<!-- TEMPLATE \(?END\)?: .+ -->$/'],
'', ['$1', ''],
$content $content
); );