Highlight text diff on client?

前端 未结 2 1100
一生所求
一生所求 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 04:11

    Check out the the wikEd diff library and the online tool and demo.

    The library creates inline text comparisons with block move highlighting and is character/word-based. It has been optimized for Wikipedia, but works equally well for other text types and program code. The library code is customizable, has Unicode support, is extensively commented, and is free (PD).

提交回复
热议问题