mirror of
https://gitee.com/chinabugotech/hutool.git
synced 2025-07-21 15:09:48 +08:00
add unescape
This commit is contained in:
@@ -18,7 +18,6 @@ public class Html4Escape extends ReplacerChain {
|
||||
{ "&", "&" }, // & - ampersand
|
||||
{ "<", "<" }, // < - less-than
|
||||
{ ">", ">" }, // > - greater-than
|
||||
{"\'", "'"} // ' - quote
|
||||
};
|
||||
|
||||
protected static final String[][] ISO8859_1_ESCAPE = { //
|
||||
|
@@ -15,11 +15,14 @@ public class Html4Unescape extends ReplacerChain {
|
||||
protected static final String[][] BASIC_UNESCAPE = InternalEscapeUtil.invert(Html4Escape.BASIC_ESCAPE);
|
||||
protected static final String[][] ISO8859_1_UNESCAPE = InternalEscapeUtil.invert(Html4Escape.ISO8859_1_ESCAPE);
|
||||
protected static final String[][] HTML40_EXTENDED_UNESCAPE = InternalEscapeUtil.invert(Html4Escape.HTML40_EXTENDED_ESCAPE);
|
||||
// issue#1118
|
||||
protected static final String[][] OTHER_UNESCAPE = new String[][]{new String[]{"'", "'"}};
|
||||
|
||||
public Html4Unescape() {
|
||||
addChain(new LookupReplacer(BASIC_UNESCAPE));
|
||||
addChain(new LookupReplacer(ISO8859_1_UNESCAPE));
|
||||
addChain(new LookupReplacer(HTML40_EXTENDED_UNESCAPE));
|
||||
addChain(new LookupReplacer(OTHER_UNESCAPE));
|
||||
addChain(new NumericEntityUnescaper());
|
||||
}
|
||||
}
|
||||
|
Reference in New Issue
Block a user