This commit is contained in:
totalo 2020-09-25 09:55:32 +08:00
parent fd3731b87f
commit 0dc720fad3
2 changed files with 2 additions and 0 deletions

View File

@ -16,6 +16,7 @@ public class Html4Escape extends ReplacerChain {
{ "&", "&" }, // & - ampersand
{ "<", "&lt;" }, // < - less-than
{ ">", "&gt;" }, // > - greater-than
{"\'", "&apos;"} // ' - quote
};
protected static final String[][] ISO8859_1_ESCAPE = { //

View File

@ -119,6 +119,7 @@ public class HtmlUtilTest {
Assert.assertEquals("&lt;html&gt;&lt;body&gt;123&#039;123&#039;&lt;/body&gt;&lt;/html&gt;", escape);
String restoreEscaped = HtmlUtil.unescape(escape);
Assert.assertEquals(html, restoreEscaped);
Assert.assertEquals("\'", HtmlUtil.unescape("&apos;"));
}
@Test