+ let [start, end] = selection?.getStartEndPoints() || [null, null];
+
+ // Ensure we ignore parent list items of the top-most list item since,
+ // although technically part of the selection, from a user point of
+ // view the selection does not spread to encompass this outer element.
+ const itemsToIgnore: Set<string> = new Set();
+ if (selection && start) {
+ if (selection.isBackward() && end) {
+ [end, start] = [start, end];
+ }