diff --git a/src/test/java/org/owasp/validator/html/test/AntiSamyTest.java b/src/test/java/org/owasp/validator/html/test/AntiSamyTest.java index 21aa664..9669343 100644 --- a/src/test/java/org/owasp/validator/html/test/AntiSamyTest.java +++ b/src/test/java/org/owasp/validator/html/test/AntiSamyTest.java @@ -2666,4 +2666,40 @@ public void testBangCommentsWhenPreservingComments() throws ScanException, Polic .getCleanHTML(), not(containsString("mxss"))); } + + @Test + public void testGithubIssue453() throws ScanException, PolicyException { + String test453 = + "\n" + + "\n" + + "\n" + + "\n" + + "\n" + + "
\n" + + ""; + String cleaned = as.scan(test453, policy, AntiSamy.SAX).getCleanHTML(); + cleaned = cleaned.replaceAll("\r?\n", ""); + cleaned = cleaned.replaceAll("\\s\\s+", " "); + + assertThat( + cleaned, + containsString( + " " + + "
" + + "