add cleanup of html string extracted from grapesjs content

This commit is contained in:
Simon Vieille 2022-06-12 23:24:41 +02:00
parent 6e0a4107c7
commit cf3bc02ed7
Signed by: deblan
GPG Key ID: 579388D585F70417
1 changed files with 9 additions and 0 deletions

View File

@ -25,6 +25,8 @@ class GrapesJsExtension extends AbstractExtension
{
$html = $this->extractData($value, 'html');
$html = str_replace($this->getHtmlStringsToRemove(), '', $html);
return preg_replace('#</?body[^>]*>#', '', $html);
}
@ -39,4 +41,11 @@ class GrapesJsExtension extends AbstractExtension
return $data[$key] ?? '';
}
protected function getHtmlStringsToRemove(): array
{
return [
'draggable="true"',
];
}
}