reconcile-text: conflict-free 3-way text merging

Think diff3 (or more specifically, git merge), but with intelligent conflict resolution that requires no user intervention. The reconcile-text library tackles a fundamental challenge in collaborative editing: what happens when multiple users edit the same text simultaneously, but the conflict resolver only has access to the final results, not the intermediate steps?

Where traditional merge tools leave you with conflict markers to resolve manually, reconcile-text automatically weaves changes together. The reconcile(parent, left, right) function takes conflicting edits and produces clean, unified results using an algorithm inspired by Operational Transformation. No more <<<<<<< markers cluttering your text.

The process starts with your chosen tokenisation strategy, then applies Myers' 2-way diff algorithm to compare the original with both modified versions. These diffs are optimised and transformed to preserve the longest meaningful changes, before a final merge strategy combines all insertions and deletions without losing any edits. Cursor positions can be tracked and updated during merging as well.

Ready to dive deeper? Check out the documentation or try editing the text boxes below to see reconcile-text in action. Use the tokenisation options to experiment with different approaches— the Rust library also supports custom tokenisers.