Skip to content

Commit a769a9d

Browse files
committed
Add test for XHTML behvior
1 parent 9084853 commit a769a9d

File tree

1 file changed

+15
-0
lines changed

1 file changed

+15
-0
lines changed

src/test/java/org/owasp/validator/html/test/AntiSamyTest.java

+15
Original file line numberDiff line numberDiff line change
@@ -2702,4 +2702,19 @@ public void testGithubIssue453() throws ScanException, PolicyException {
27022702
+ "<select name=\"Lang\"> "
27032703
+ "<option value=\"da\">Dansk</option> "));
27042704
}
2705+
2706+
@Test
2707+
public void issue484() throws ScanException, PolicyException {
2708+
String s = "<p>this is para data</p><br/><p>this is para data 2</p>";
2709+
CleanResults crDom = as.scan(s, policy, AntiSamy.DOM);
2710+
CleanResults crSax = as.scan(s, policy, AntiSamy.SAX);
2711+
String domValue = crDom.getCleanHTML();
2712+
String saxValue = crSax.getCleanHTML();
2713+
assertEquals("<p>this is para data</p>\n"
2714+
+ "<br>\n"
2715+
+ "<p>this is para data 2</p>", domValue);
2716+
assertEquals("<p>this is para data</p>\n"
2717+
+ "<br/>\n"
2718+
+ "<p>this is para data 2</p>", saxValue);
2719+
}
27052720
}

0 commit comments

Comments
 (0)