Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Support custom html tags and attributes #68

Open
wants to merge 11 commits into
base: master
Choose a base branch
from

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