Nova Ckeditor
  • 🏁Getting Started
    • Introduction
    • Installation
    • Support Us
    • License
    • Demo
  • 🚀Basic Usage
    • Usage
    • Notes
  • ⚙️Advanced Usage
    • Customize ImageStorage
    • Integrating NovaFileArtisan (Larupload) with Image Resource
    • Customize AudioStorage
    • Customize FileStorage
    • Multiple Toolbars
    • Customize Toolbar Items
    • Media Embed
    • CkEditor Field Options
      • Toolbar
      • Height
      • Limit On Index
      • Content Language
      • Force Paste as Plain Text
      • Alert Before Unsaved Changes
      • Text Part Language
      • General HTML Support
      • Group Items In Overflow Mode
      • Image Browser
      • Audio Browser
      • Video Browser
      • File Browser
      • Snippets
    • Configuration
      • Video Model
      • Image Model
      • Memory
      • Max Image Quality
      • Image Max Width
      • Image Max Height
      • Image Naming Method
      • Image Processing Library
      • Audio Naming Method
      • File Naming Method
      • Toolbars
        • Default Toolbar
        • Toolbar 1
          • Height
          • Items
          • Options
          • Content Lang
          • Force Paste as Plain Text
          • Alert Before Unsaved Changes
          • UI Language
            • UI Language Name
            • UI Language Script
          • Text Part Language
          • General HTML Support
          • Group Items In Overflow Mode
          • Image Browser
          • Audio Browser
          • Video Browser
          • File Browser
          • Insert Image Types
          • Insert Image Size
          • Snippets
  • ⚪Other
    • Migration
    • Credit and Thanks
Powered by GitBook
On this page
Edit on GitHub
  1. Advanced Usage
  2. CkEditor Field Options

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' => []
                ]
            )
        ];
    }
}
PreviousText Part LanguageNextGroup Items In Overflow Mode

Last updated 8 months ago

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

⚙️
CKEditor 5 documentation on General HTML Support