Merge pull request #1121 from totalo/v5-dev

fixed #1118
This commit is contained in:
Golden Looly 2020-09-25 17:59:49 +08:00 committed by GitHub
commit 4899e03a48
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 2 additions and 0 deletions

View File

@ -18,6 +18,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