# HtmlPageDataProcessor

class

The full page HTML data processor class. This data processor implementation uses HTML as input and output data.

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

<a id="properties">

## Properties

<a id="member-domConverter">

### `domConverter: ViewDomConverter` _(inherited)_

A DOM converter used to convert DOM elements to view elements.

[See source](https://github.com/ckeditor/ckeditor5/blob/master/packages/ckeditor5-engine/src/dataprocessor/htmldataprocessor.ts#L34)

<a id="member-domParser">

### `domParser: DOMParser` _(inherited)_

A DOM parser instance used to parse an HTML string to an HTML document.

[See source](https://github.com/ckeditor/ckeditor5/blob/master/packages/ckeditor5-engine/src/dataprocessor/htmldataprocessor.ts#L29)

<a id="member-htmlWriter">

### `htmlWriter: DataProcessorHtmlWriter` _(inherited)_

A basic HTML writer instance used to convert DOM elements to an HTML string.

[See source](https://github.com/ckeditor/ckeditor5/blob/master/packages/ckeditor5-engine/src/dataprocessor/htmldataprocessor.ts#L39)

<a id="member-skipComments">

### `skipComments: boolean` _(inherited)_

If `false`, comment nodes will be converted to `$comment`. Otherwise comment nodes are ignored.

[See source](https://github.com/ckeditor/ckeditor5/blob/master/packages/ckeditor5-engine/src/dataprocessor/htmldataprocessor.ts#L41)

<a id="methods">

## Methods

<a id="function-constructor">

### `constructor( document )` _(inherited)_

Creates a new instance of the HTML data processor class.

[See source](https://github.com/ckeditor/ckeditor5/blob/master/packages/ckeditor5-engine/src/dataprocessor/htmldataprocessor.ts#L48)

#### Parameters

* `document: ViewDocument`

  The view document instance.

<a id="function-registerRawContentMatcher">

### `registerRawContentMatcher( pattern ) → void` _(inherited)_

Registers a [`MatcherPattern`](module_engine_view_matcher-MatcherPattern.md) for view elements whose content should be treated as raw data and not processed during the conversion from the DOM to the view elements.

The raw data can be later accessed by a [custom property of a view element](module_engine_view_element-ViewElement.md#function-getCustomProperty) called `"$rawContent"`.

[See source](https://github.com/ckeditor/ckeditor5/blob/master/packages/ckeditor5-engine/src/dataprocessor/htmldataprocessor.ts#L91)

#### Parameters

* `pattern: MatcherPattern`

  Pattern matching all view elements whose content should be treated as raw data.

#### Returns

* `void`

<a id="function-toData">

### `toData( viewFragment ) → string`

Converts a provided [document fragment](module_engine_view_documentfragment-ViewDocumentFragment.md) to data format – in this case to an HTML string.

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

#### Parameters

* `viewFragment: ViewDocumentFragment`

#### Returns

* `string`

  HTML string.

<a id="function-toView">

### `toView( data ) → ViewDocumentFragment`

Converts the provided HTML string to a view tree.

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

#### Parameters

* `data: string`

  An HTML string.

#### Returns

* `ViewDocumentFragment`

  A converted view element.

<a id="function-useFillerType">

### `useFillerType( type ) → void` _(inherited)_

If the processor is set to use marked fillers, it will insert `&nbsp;` fillers wrapped in `<span>` elements (`<span data-cke-filler="true">&nbsp;</span>`) instead of regular `&nbsp;` characters.

This mode allows for a more precise handling of the block fillers (so they do not leak into the editor content) but bloats the editor data with additional markup.

This mode may be required by some features and will be turned on by them automatically.

[See source](https://github.com/ckeditor/ckeditor5/blob/master/packages/ckeditor5-engine/src/dataprocessor/htmldataprocessor.ts#L106)

#### Parameters

* `type: 'default' | 'marked'`

  Whether to use the default or the marked `&nbsp;` block fillers.

#### Returns

* `void`

<a id="function-_toDom">

### `_toDom( data ) → DocumentFragment` _(protected)_

Converts an HTML string to its DOM representation. Returns a document fragment containing nodes parsed from the provided data.

[See source](https://github.com/ckeditor/ckeditor5/blob/master/packages/ckeditor5-engine/src/dataprocessor/htmldataprocessor.ts#L114)

#### Parameters

* `data: string`

#### Returns

* `DocumentFragment`

---

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