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

  • _remove( range ) → Array.<Node>

    protected static

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

    Parameters

    range : Range

    Range containing nodes to remove.

    Returns

    Array.<Node>
  • _setAttribute( range, key, value )

    protected static

    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.

  • insert( position, nodes ) → Range

    protected static

    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.

  • move( sourceRange, targetPosition ) → Range

    protected static

    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.

  • normalizeNodes( nodes ) → Array.<Node>

    protected static

    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.