Skip to content

Conversation

mauritskorse
Copy link

@mauritskorse mauritskorse commented Apr 17, 2024

This PR is for allowing custom tags and attributes to be configured such that they will not be removed by HTMLPurifier.
Also see request: #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',
                ],
            ],
        ],
    ],
];

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant