Namespace

utils (engine/model/operation)

@ckeditor/ckeditor5-engine/src/model/operation/utils

namespace protected

Contains functions used for composing model tree by operations. Those functions are built on top of node, and it's child classes', APIs.

Filtering

Functions

  • protected static

    _remove( range ) → Array.<Node>

    Removed nodes in given range. Only flat ranges are accepted.

    Parameters

    range : Range

    Range containing nodes to remove.

    Returns

    Array.<Node>
  • protected static

    _setAttribute( range, key, value )

    Sets given attribute on nodes in given range. The attributes are only set on top-level nodes of the range, not on its children.

    Parameters

    range : Range

    Range containing nodes that should have the attribute set. Must be a flat range.

    key : String

    Key of attribute to set.

    value : *

    Attribute value.

  • protected static

    insert( position, nodes ) → Range

    Inserts given nodes at given position.

    Parameters

    position : Position

    Position at which nodes should be inserted.

    nodes : NodeSet

    Nodes to insert.

    Returns

    Range

    Range spanning over inserted elements.

  • protected static

    move( sourceRange, targetPosition ) → Range

    Moves nodes in given range to given target position. Only flat ranges are accepted.

    Parameters

    sourceRange : Range

    Range containing nodes to move.

    targetPosition : Position

    Position to which nodes should be moved.

    Returns

    Range

    Range containing moved nodes.

  • protected static

    normalizeNodes( nodes ) → Array.<Node>

    Normalizes given object or an array of objects to an array of nodes. See NodeSet for details on how normalization is performed.

    Parameters

    nodes : NodeSet

    Objects to normalize.

    Returns

    Array.<Node>

    Normalized nodes.