remove the tag <body> from grapesjs html output (in twig filter)

This commit is contained in:
Simon Vieille 2022-04-13 12:41:57 +02:00
parent 3399b255b1
commit c7f9fc94b0
Signed by: deblan
GPG key ID: 03383D15A1D31745

View file

@ -23,7 +23,9 @@ class GrapesJsExtension extends AbstractExtension
public function getHtml(?string $value): ?string
{
return $this->extractData($value, 'html');
$html = $this->extractData($value, 'html');
return preg_replace('#</?body[^>]*>#', '', $html);
}
public function getCss(?string $value): ?string