Sign up (with export icon)

HtmlPageDataProcessor

Api-class iconclass

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

Properties

  • Chevron-right icon

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

  • Chevron-right icon

    domParser: DOMParser
    inherited

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

  • Chevron-right icon

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

  • Chevron-right icon

    skipComments: boolean
    inherited

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

    Defaults to true

  • Chevron-right icon

    skipProcessingInstructions: boolean
    inherited

    If false, processing instruction nodes (for example <?target data?>) will be converted. Otherwise, processing instruction nodes are ignored.

    Defaults to true

Methods

  • Chevron-right icon

    constructor( document )
    inherited

    Creates a new instance of the HTML data processor class.

    Parameters

    document: ViewDocument

    The view document instance.

  • Chevron-right icon

    registerRawContentMatcher( pattern ) → void
    inherited

    Registers a MatcherPattern 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 called "$rawContent".

    Parameters

    pattern: MatcherPattern

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

    Returns

    void
  • Chevron-right icon

    toData( viewFragment ) → string

    Converts a provided document fragment to data format – in this case to an HTML string.

    Parameters

    viewFragment: ViewDocumentFragment

    Returns

    string

    HTML string.

  • Chevron-right icon

    Converts the provided HTML string to a view tree.

    Parameters

    data: string

    An HTML string.

    Returns

    ViewDocumentFragment

    A converted view element.

  • Chevron-right icon

    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.

    Parameters

    type: 'default' | 'marked'

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

    Returns

    void
  • Chevron-right icon

    _toDom( data ) → DocumentFragment
    protectedinherited

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

    Parameters

    data: string

    Returns

    DocumentFragment