Problem
Minimal edit scripts sometimes align on short coincidental islands (a stray equal token inside what a human reads as one replaced block). diff-match-patch ships `cleanupSemantic` for this; we have `refine` (finer) but nothing that coarsens noisy regions.
Proposal
Opt-in `cleanup: 'semantic'` post-pass: merge equal islands shorter than the surrounding change into the change, and shift change boundaries to word/line edges where equivalent (boundary sliding, like git's diff-slider heuristics).
Notes
- Must preserve the round-trip invariant; only regroups entries.
- Add before/after examples to the README and demo.
Problem
Minimal edit scripts sometimes align on short coincidental islands (a stray equal token inside what a human reads as one replaced block). diff-match-patch ships `cleanupSemantic` for this; we have `refine` (finer) but nothing that coarsens noisy regions.
Proposal
Opt-in `cleanup: 'semantic'` post-pass: merge equal islands shorter than the surrounding change into the change, and shift change boundaries to word/line edges where equivalent (boundary sliding, like git's diff-slider heuristics).
Notes