Browse Source

add cleanup of html string extracted from grapesjs content

develop
Simon Vieille 2 weeks ago
parent
commit
cf3bc02ed7
Signed by: deblan
GPG Key ID: 579388D585F70417
  1. 9
      src/core/Twig/Extension/GrapesJsExtension.php

9
src/core/Twig/Extension/GrapesJsExtension.php

@ -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"',
];
}
}

Loading…
Cancel
Save