editorjs-php
editorjs-php copied to clipboard
Support custom html tags and attributes
This PR is for allowing custom tags and attributes to be configured such that they will not be removed by HTMLPurifier. Also see request: https://github.com/editor-js/editorjs-php/issues/29 My personal use case is that I Laravel Blade components or Livewire components to be generated.
This can be done by adding the custom tags/attributes to the config like so:
// config/editorjs.php
return [
//...
'validationSettings' => [
'tools' => [
//...
],
'customTags' => [
// allow <dfn type="" slug="" class="" description=""></dfn>
'dfn' => [
'type' => 'Inline',
'contents' => 'Inline',
'collection' => 'Common',
'attributes' => [
'type' => 'CDATA',
'slug' => 'CDATA',
'class' => 'CDATA',
'description' => 'CDATA',
],
],
],
],
];