Highlight text diff on client?

前端 未结 2 1099
一生所求
一生所求 2020-12-14 03:31

I want to compare 2 text values on a web page and highlight the differences. Can I do this client-side, preferably with jQuery or Prototype?

2条回答
  •  时光取名叫无心
    2020-12-14 03:55

    This diff-patch-match library appears to do a really good job:

    http://code.google.com/p/google-diff-match-patch/

    The project has JavaScript, C#, C++, Python, and Java implementations that all do the same thing.

提交回复
热议问题