Report an issue
Class

CKEDITOR.htmlParser.comment

class

A lightweight representation of an HTML comment.

Filtering

Properties

  • readonly

    type : Number

    The node type. This is a constant value set to CKEDITOR.NODE_COMMENT.

    Defaults to CKEDITOR.NODE_COMMENT

  • value : String

    The comment text.

  • private

    _ : Object

    Defaults to {isBlockLike: false}

Methods

  • inherited

    constructor() → node

    Creates a node class instance.

    Returns

    node
  • since 4.1.0

    filter( filter ) → Boolean

    Filter this comment with given filter.

    Parameters

    filter : filter

    Returns

    Boolean

    Method returns false when this comment has been removed or replaced with other node. This is an information for CKEDITOR.htmlParser.element.filterChildren that it has to repeat filter on current position in parent's children array.

  • since 4.3.0 inherited

    getAscendant( condition ) → element

    Gets the closest ancestor element of this element which satisfies given condition

    Parameters

    condition : String | Object | Function

    Name of an ancestor, hash of names or validator function.

    Returns

    element

    The closest ancestor which satisfies given condition or null.

  • since 4.3.0 inherited

    getIndex() → Number

    Gets this node's index in its parent's children array.

    Returns

    Number
  • since 4.1.0 inherited

    insertAfter( node )

    Insert this node after given one.

    Parameters

    node : node

    The node that will precede this element.

  • since 4.1.0 inherited

    insertBefore( node )

    Insert this node before given one.

    Parameters

    node : node

    The node that will follow this element.

  • since 4.1.0 inherited

    remove()

    Remove this node from a tree.

  • since 4.1.0 inherited

    replaceWith( node )

    Replace this node with given one.

    Parameters

    node : node

    The node that will replace this one.

  • since 4.3.0 inherited

    wrapWith( wrapper ) → element

    Wraps this element with given wrapper.

    Parameters

    wrapper : element

    The element which will be this element's new parent.

    Returns

    element

    Wrapper.

  • writeHtml( writer, [ filter ] )

    Writes the HTML representation of this comment to a CKEDITOR.htmlWriter.

    Parameters

    writer : basicWriter

    The writer to which write the HTML.

    [ filter ] : filter

    The filter to be applied to this node. Note: it's unsafe to filter offline (not appended) node.