Skip to content

Commit

Permalink
Add test for XHTML behvior
Browse files Browse the repository at this point in the history
  • Loading branch information
spassarop committed Aug 11, 2024
1 parent 9084853 commit a769a9d
Showing 1 changed file with 15 additions and 0 deletions.
15 changes: 15 additions & 0 deletions src/test/java/org/owasp/validator/html/test/AntiSamyTest.java
Original file line number Diff line number Diff line change
Expand Up @@ -2702,4 +2702,19 @@ public void testGithubIssue453() throws ScanException, PolicyException {
+ "<select name=\"Lang\"> "
+ "<option value=\"da\">Dansk</option> "));
}

@Test
public void issue484() throws ScanException, PolicyException {
String s = "<p>this is para data</p><br/><p>this is para data 2</p>";
CleanResults crDom = as.scan(s, policy, AntiSamy.DOM);
CleanResults crSax = as.scan(s, policy, AntiSamy.SAX);
String domValue = crDom.getCleanHTML();
String saxValue = crSax.getCleanHTML();
assertEquals("<p>this is para data</p>\n"
+ "<br>\n"
+ "<p>this is para data 2</p>", domValue);
assertEquals("<p>this is para data</p>\n"
+ "<br/>\n"
+ "<p>this is para data 2</p>", saxValue);
}
}

0 comments on commit a769a9d

Please sign in to comment.