A more intuitive nodesBetween wrapper. Goes only through the nodes inside or touching the selection.
Does not go through wrapping parents (except the first by default) that start/end before/after the given positions like nodesBetween.
This can be changed by using the shift option, or fromShift and toShift.
shift
fromShift
toShift
For example, if the cursor is in the middle of some text, using {shift: 0}, you would only get the text node.
{shift: 0}
To get whatever it's parent item is, we need {shift: -1} (the default, since this is the most common use case).
{shift: -1}
A more intuitive nodesBetween wrapper. Goes only through the nodes inside or touching the selection.
Does not go through wrapping parents (except the first by default) that start/end before/after the given positions like nodesBetween.
This can be changed by using the
shiftoption, orfromShiftandtoShift.For example, if the cursor is in the middle of some text, using
{shift: 0}, you would only get the text node.To get whatever it's parent item is, we need
{shift: -1}(the default, since this is the most common use case).