Sign up (with export icon)

GeneralHtmlSupportConfig

Api-interface icon interface

The configuration of the General HTML Support feature. The option is used by the GeneralHtmlSupport feature.

ClassicEditor
	.create( {
		htmlSupport: ... // General HTML Support feature config.
	} )
	.then( ... )
	.catch( ... );
Copy code

See all editor options.

Properties

  • Chevron-right icon

    allow : Array<MatcherObjectPattern> | undefined

    The configuration of allowed content rules used by General HTML Support.

    Setting this configuration option will enable HTML features that are not explicitly supported by any other dedicated CKEditor 5 features.

    const htmlSupportConfig.allow = [
    	{
    		name: 'div',                      // Enable 'div' element support,
    		classes: [ 'special-container' ], // allow 'special-container' class,
    		styles: 'background',             // allow 'background' style,
    		attributes: true                  // allow any attribute (can be empty).
    	},
    	{
    		name: 'p',                                   // Extend existing Paragraph feature,
    		classes: 'highlighted'                       // with 'highlighted' class,
    		attributes: [
    			{ key: 'data-i18n-context, value: true } // and i18n attribute.
    		]
    	}
    ];
    
    Copy code
  • Chevron-right icon

    allowEmpty : Array<string> | undefined

    The configuration of allowed empty inline elements that should not be removed.

    Note that you should also add an appropriate entry to allow list.

    const htmlSupportConfig.allowEmpty = [ 'i', 'span' ];
    
    Copy code
  • Chevron-right icon

    disallow : Array<MatcherObjectPattern> | undefined

    The configuration of disallowed content rules used by General HTML Support.

    Setting this configuration option will disable listed HTML features.

    const htmlSupportConfig.disallow = [
    	{
    		name: /[\s\S]+/    // For every HTML feature,
    		attributes: {
    			key: /^on.*$/ // disable 'on*' attributes, like 'onClick', 'onError' etc.
    		}
    	}
    ];
    
    Copy code
  • Chevron-right icon

    The configuration of the Full page editing feature. The option is used by the FullPage feature.

    ClassicEditor
    	.create( {
    		htmlSupport: {
    			fullPage: ... // Full page feature config.
    		}
    	} )
    	.then( ... )
    	.catch( ... );
    
    Copy code
  • Chevron-right icon

    preserveEmptyBlocksInEditingView : boolean | undefined

    Whether a filler text (non-breaking space entity — &nbsp;) will be inserted into empty block elements in HTML output. This is used to render block elements properly with line-height.

    When set to true, empty blocks will be preserved in the editing view. When false (default), empty blocks are only preserved in the data output.

    The option is used by the EmptyBlock feature.

    Defaults to false