docs/solutions/logic-errors/2026-05-09-expanded-delete-across-inline-boundaries-must-remove-crossed-inline-ancestors.md
Lexical regression 1083 exposed an expanded-delete boundary that Slate did not prove: deleting a range that starts at inline link content and continues outside that inline should remove the inline element, not leave an empty shell.
Say[link:Hello]World, selecting HelloWorld, could
delete text but leave an empty link plus empty trailing text.Add package proof for both accepted rows in
.tmp/slate-v2/packages/slate/test/delete-contract.ts:
Then make delete-text.ts collect fully-selected inline ancestors only when the
expanded range crosses outside that inline. That keeps legacy inside-inline
delete behavior intact while removing empty inline shells for boundary-crossing
deletes.
Slate normalizes an empty spacer before leading inline content. The full selection proof must include that spacer, while the partial proof starts inside the link. In both accepted rows, the selected inline is not merely emptied; the selection crosses out of it, so the inline element is part of the deleted structure.
Selections wholly inside an inline are different. Those should delete inline contents and preserve the inline shell, which the existing delete fixtures lock.
transforms/delete fixture suite.