General HTML Support

htmlSupport

Argument
Type
Required
Default

htmlSupport

array

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' => []
                ]
            )
        ];
    }
}

For more detailed information on using the General HTML Support feature, refer to the CKEditor 5 documentation on General HTML Support.

Last updated