Report an issue
Class

CKEDITOR.htmlParser.text

class

A lightweight representation of HTML text.

Filtering

Properties

  • type : Number

    readonly

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

    Defaults to CKEDITOR.NODE_TEXT

  • value : String

    The text value.

  • _ : Object

    private

    Defaults to {isBlockLike: false}

Methods

  • constructor() → node

    inherited

    Creates a node class instance.

    Returns

    node
  • filter( filter ) → Boolean

    since 4.1.0

    Filter this text node with given filter.

    Parameters

    filter : filter

    Returns

    Boolean

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

  • getAscendant( condition ) → element

    since 4.3.0 inherited

    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.

  • getIndex() → Number

    since 4.3.0 inherited

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

    Returns

    Number
  • insertAfter( node )

    since 4.1.0 inherited

    Insert this node after given one.

    Parameters

    node : node

    The node that will precede this element.

  • insertBefore( node )

    since 4.1.0 inherited

    Insert this node before given one.

    Parameters

    node : node

    The node that will follow this element.

  • remove()

    since 4.1.0 inherited

    Remove this node from a tree.

  • replaceWith( node )

    since 4.1.0 inherited

    Replace this node with given one.

    Parameters

    node : node

    The node that will replace this one.

  • wrapWith( wrapper ) → element

    since 4.3.0 inherited

    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 text to a {CKEDITOR.htmlParser.basicWriter}.

    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.