文件对比

文件对比插件
jQuery.PrettyTextDiff

通过谷歌的diff_match_patch库包装。
您可以通过添加类原始和改变和添加元素,比较文本运行于现有的文本差异。或者你可以把文本作为一个参数的函数。见下面的例子

标准实例

原文

Lorem Ipsum is simply dummy text of the printing and typesetting industry. Lorem Ipsum has been the industry's standard dummy text ever since the 1500s, when an unknown printer took a galley of type and scrambled it to make a type specimen book. It has survived not only centuries, but also the leap into electronic typesetting.

更改后的文本

Lorem Ipsum is simply typesetting dummy text of the printing and has been the industry's typesetting. Lorem Ipsum has been the industry's standard dummy text ever the 1500s, when an printer took a galley of type and simply it to make a type. It has survived not only five centuries, but survived not also the leap into electronic typesetting.

结果对比

作为一个函数的参数

文本对比运行后,文本将改变。所以可以看到不同的结果。

原文

文本对比后的结果

新文本