Skip to content

Latest commit

 

History

History
44 lines (34 loc) · 1.59 KB

general-html-support.md

File metadata and controls

44 lines (34 loc) · 1.59 KB
description
htmlSupport

General HTML Support

ArgumentTypeRequiredDefault
htmlSupportarraytrue

This method allows you to enable General HTML Support (GHS) within the editor, providing flexibility to include HTML elements, attributes, classes, and styles that are not supported by other dedicated CKEditor 5 plugins. This ensures that your desired markup, including custom elements, attributes, classes, and styles, remains preserved within the editor window and in the final output.

use Mostafaznv\NovaCkEditor\CkEditor;

class Article extends Resource
{
    public function fields(Request $request): array
    {
        return [
            CkEditor::make(trans('Content'), 'content')
                ->htmlSupport([
                    'allow' => [
                        [
                            'name'    => 'div',
                            'classes' => true,
                        ],
                        [
                            'name' => '/^(div|section|article)$/'
                        ]
                    ],
    
                    'disallow' => []
                ]
            )
        ];
    }
}

{% hint style="info" %} For more detailed information on using the General HTML Support feature, refer to the CKEditor 5 documentation on General HTML Support. {% endhint %}