Report an issue
Class

CKEDITOR.htmlDataProcessor

class

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

Filtering

Properties

Methods

  • constructor( editor ) → htmlDataProcessor

    Creates an htmlDataProcessor class instance.

    Parameters

    editor : editor

    Returns

    htmlDataProcessor
  • toDataFormat( html, [ options ] ) → String

    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

    The options object.

    Properties
    [ context ] : String

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

    [ filter ] : filter

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

    [ enterMode ] : Number

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

    Returns

    String
  • toHtml( data, [ options ] ) → String

    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

    The options object.

    Properties
    [ context ] : String

    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

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

    Defaults to true

    [ filter ] : filter

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

    [ dontFilter ] : Boolean

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

    [ enterMode ] : Number

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

    [ protectedWhitespaces ] : Boolean

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

    Returns

    String