collapseElementsInRange

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.

Arguments

  1. rangeToCollapseIn

    (Required)

    The range to collapse on

  2. elementsToCollapse

    (Required)

    Type: Array<Element>

    The elements which should be (partially) collapsed

  3. blueprint

    (Required)

    Type: Blueprint

    The blueprint in which to perform the operation

  4. format

    (Required)

    Type: Format

    The format used to validate the result

  5. resultingRange

    (Optional)

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

Returns

Type: Boolean

Whether the operation was successful.