Reputation: 16815
Is there in any JavaScript framework UI component to show diffs between two strings?
Upvotes: 3
Views: 876
Reputation: 1199
Try looking at Pretty Diff. It is somewhat based upon the diff tool by Chas Emerick. The Chas Emerick tool has not been update in about 5 years though, where the diff engine in Pretty Diff is entirely rewritten for performance, provides differences per character in addition to per line, and it is more stable without a bunch of crap to bind it to Python. Pretty Diff is also language aware so that radical differences in white space are irrelevant and provides additional options to remove other potential false positive concerns from the final diff report.
Upvotes: 0
Reputation: 1035
You might try this one: http://cemerick.github.com/jsdifflib/demo.html
Also John Resig has a nice post here with code: http://ejohn.org/projects/javascript-diff-algorithm/
Upvotes: 1