Java 如何知道Jsoup删除哪个文本?

Java 如何知道Jsoup删除哪个文本?,java,jsoup,Java,Jsoup,我有以下案文: text<html/>text 我将记录用户的错误,如:指定了恶意内容::。 但我不知道如何正确地确定Jsoup是干净的 我曾尝试使用StringUtils.difference(cleanedValue,value),但该方法的工作方式是另一种,即文档说明: Compares two Strings, and returns the portion where they differ. (More precisely, return the remainder o

我有以下案文:

text<html/>text
我将记录用户的错误,如:
指定了恶意内容::。
但我不知道如何正确地确定Jsoup是干净的

我曾尝试使用StringUtils.difference(cleanedValue,value),但该方法的工作方式是另一种,即文档说明:

Compares two Strings, and returns the portion where they differ.
(More precisely, return the remainder of the second String,
starting from where it's different from the first.)
结果它返回如下字符串:
text

了解java中用于比较字符串的任何差异工具都很好。

Diff Match和Patch库提供了健壮的算法来执行同步纯文本所需的操作

差异: 比较两个纯文本块并高效地返回差异列表

匹配: 给定搜索字符串,在纯文本块中查找其最佳模糊匹配。为精度和位置加权

补丁: 将修补程序列表应用于纯文本。即使基础文本不匹配,也要尽最大努力应用修补程序

目前在java、javascript、Dart、C++、c++、目标C、Lua和Python中可用。无论使用何种语言,每个库都具有相同的API和相同的功能。所有版本都有全面的测试线束

有一个wiki页面描述了如何逐行进行差异化

Compares two Strings, and returns the portion where they differ.
(More precisely, return the remainder of the second String,
starting from where it's different from the first.)