Type: Function

Collapses the given elements on those parts that overlap the given range, ensuring that no part of rangeToCollapseIn is covered by the elementsToCollapse afterwards.

As the default behavior is to leave positions on the left side of any splits, an optional range can be passed in, which will be moved into the collapsed part if its positions fall on the edges.

Refer to primitives for more information on how to include this primitive.


  1. rangeToCollapseIn


    The range to collapse on

  2. elementsToCollapse


    Type: Array<Element>

    The elements which should be (partially) collapsed

  3. blueprint


    Type: Blueprint

    The blueprint in which to perform the operation

  4. format


    Type: Format

    The format used to validate the result

  5. resultingRange


    Range to adjust for the collapse operation, keeping positions in place relative to the collapsed elements' children.


Type: Boolean

Whether the operation was successful.