# GeneralHtmlSupportConfig

interface

The configuration of the General HTML Support feature. The option is used by the [`GeneralHtmlSupport`](module_html-support_generalhtmlsupport-GeneralHtmlSupport.md) feature.

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

See [all editor options](module_core_editor_editorconfig-EditorConfig.md).

[See source](https://github.com/ckeditor/ckeditor5/blob/master/packages/ckeditor5-html-support/src/generalhtmlsupportconfig.ts#L27)

<a id="properties">

## Properties

<a id="member-allow">

### `allow?: Array<MatcherObjectPattern>`

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.

```typescript
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.
		]
	}
];
```

[See source](https://github.com/ckeditor/ckeditor5/blob/master/packages/ckeditor5-html-support/src/generalhtmlsupportconfig.ts#L53)

<a id="member-allowEmpty">

### `allowEmpty?: Array<string>`

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

Note that you should also add an appropriate entry to [`allow`](#member-allow) list.

```typescript
const htmlSupportConfig.allowEmpty = [ 'i', 'span' ];
```

[See source](https://github.com/ckeditor/ckeditor5/blob/master/packages/ckeditor5-html-support/src/generalhtmlsupportconfig.ts#L82)

<a id="member-disallow">

### `disallow?: Array<MatcherObjectPattern>`

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

Setting this configuration option will disable listed HTML features.

```typescript
const htmlSupportConfig.disallow = [
	{
		name: /[\s\S]+/	// For every HTML feature,
		attributes: {
			key: /^on.*$/ // disable 'on*' attributes, like 'onClick', 'onError' etc.
		}
	}
];
```

[See source](https://github.com/ckeditor/ckeditor5/blob/master/packages/ckeditor5-html-support/src/generalhtmlsupportconfig.ts#L71)

<a id="member-fullPage">

### `fullPage?: GHSFullPageConfig`

The configuration of the Full page editing feature. The option is used by the [`FullPage`](module_html-support_fullpage-FullPage.md) feature.

```typescript
ClassicEditor
	.create( {
		htmlSupport: {
			fullPage: ... // Full page feature config.
		}
	} )
	.then( ... )
	.catch( ... );
```

[See source](https://github.com/ckeditor/ckeditor5/blob/master/packages/ckeditor5-html-support/src/generalhtmlsupportconfig.ts#L112)

<a id="member-htmlIframeSandbox">

### `htmlIframeSandbox?: boolean | Array<string>`

Controls the `sandbox` attribute on iframe elements by specifying allowed sandbox flags.

**Note:** This option only affects the editing view and does not modify the data output.

When set to `false`:

* The sandbox attribute will not be modified or added to iframe elements.

When set to `true`:

* All restrictions are enforced by adding an empty `sandbox` attribute to iframe elements.

When set to an array of strings:

* Only the specified sandbox flags will be preserved on iframe elements.
* Any sandbox flags not in the list will be automatically removed.
* If an empty array is provided, the `sandbox` attribute will be added with no flags (enforcing all restrictions).

```typescript
ClassicEditor
	.create( {
		htmlSupport: {
			// All restrictions are enforced (empty sandbox attribute).
			htmlIframeSandbox: true
		}
	} )
	.then( ... )
	.catch( ... );
```

[See source](https://github.com/ckeditor/ckeditor5/blob/master/packages/ckeditor5-html-support/src/generalhtmlsupportconfig.ts#L147)

Defaults to `true`

<a id="member-preserveEmptyBlocksInEditingView">

### `preserveEmptyBlocksInEditingView?: boolean`

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`](module_html-support_emptyblock-EmptyBlock.md) feature.

[See source](https://github.com/ckeditor/ckeditor5/blob/master/packages/ckeditor5-html-support/src/generalhtmlsupportconfig.ts#L95)

Defaults to `false`

---

Full index of the CKEditor 5 API reference: [llms.txt](llms.txt)
