CKEditor 4 Documentation

CKEDITOR.htmlDataProcessor

Hierarchy

CKEDITOR.dataProcessor
CKEDITOR.htmlDataProcessor

Files

Represents an HTML data processor, which is responsible for translating and transforming the editor data on input and output.

Defined By

Properties

Data filter used when processing input by toHtml.

Data filter used when processing input by toHtml.

HTML filter used when processing output by toDataFormat.

HTML filter used when processing output by toDataFormat.

The HTML writer used by this data processor to format the output.

The HTML writer used by this data processor to format the output.

Defined By

Methods

CKEDITOR.htmlDataProcessor
view source
new( editor ) : CKEDITOR.htmlDataProcessor
Creates an htmlDataProcessor class instance. ...

Creates an htmlDataProcessor class instance.

Parameters

Returns

CKEDITOR.htmlDataProcessor
view source
( html, [options] ) : String
See CKEDITOR.dataProcessor.toDataFormat. ...

See CKEDITOR.dataProcessor.toDataFormat.

This method fires the CKEDITOR.editor.toDataFormat event which makes it possible to hook into the process at various stages.

Parameters

  • html : String
  • options : Object (optional)

    The options object.

    • context : String (optional)

      The tag name of the context element within which the input is to be processed, defaults to the editable element.

    • filter : CKEDITOR.filter (optional)

      When specified, instead of using the main filter, the passed instance will be used to apply content transformations to the content.

    • enterMode : Number (optional)

      When specified, it will be used instead of the main enterMode.

Returns

  • String

Overrides: CKEDITOR.dataProcessor.toDataFormat

CKEDITOR.htmlDataProcessor
view source
( data, [options] ) : String
Processes the (potentially malformed) input HTML to a purified form which is suitable for using in the WYSIWYG editable. ...

Processes the (potentially malformed) input HTML to a purified form which is suitable for using in the WYSIWYG editable.

This method fires the CKEDITOR.editor.toHtml event which makes it possible to hook into the process at various stages.

Note: Since CKEditor 4.3 the signature of this method changed and all options are now grouped in one options object. Previously context, fixForBody and dontFilter were passed separately.

Parameters

  • data : String

    The raw data.

  • options : Object (optional)

    The options object.

    • context : String (optional)

      The tag name of a context element within which the input is to be processed, defaults to the editable element. If null is passed, then data will be parsed without context (as children of CKEDITOR.htmlParser.fragment). See CKEDITOR.htmlParser.fragment.fromHtml for more details.

    • fixForBody : Boolean (optional)

      Whether to trigger the auto paragraph for non-block content.

      Defaults to: true

    • filter : CKEDITOR.filter (optional)

      When specified, instead of using the main filter, the passed instance will be used to filter the content.

    • dontFilter : Boolean (optional)

      Do not filter data with CKEDITOR.filter (note: transformations will still be applied).

    • enterMode : Number (optional)

      When specified, it will be used instead of the main enterMode.

    • protectedWhitespaces : Boolean (optional)

      Indicates that content was wrapped with <span> elements to preserve leading and trailing whitespaces. Option used by the CKEDITOR.editor.insertHtml method.

Returns

  • String

Overrides: CKEDITOR.dataProcessor.toHtml