Skip to content

Commit fde3c9e

Browse files
adding unit test for table formatting issue
1 parent 2bc9f51 commit fde3c9e

File tree

1 file changed

+9
-0
lines changed

1 file changed

+9
-0
lines changed

src/test/java/org/owasp/html/ExamplesTest.java

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -101,4 +101,13 @@ public static final void testTextAllowedInLinks() {
101101
"<a href=\"../good.html\" rel=\"nofollow\">click here</a>",
102102
sanitized);
103103
}
104+
105+
@Test
106+
public static final void testTableStructure() {
107+
String input = "<TABLE><TR><TD>Green Zone Bulk mail<TD>21 entries<TR><TH>Type<TH>Date<TH>Size<TH>Country<TR><TD>Junk<TD>March 26<TD>25KB<TD>US";
108+
String sanitized = Sanitizers.TABLES.sanitize(input);
109+
assertEquals(
110+
"<table><tbody><tr><td>Green Zone Bulk mail</td><td>21 entries</td></tr><tr><th>Type</th><th>Date</th><th>Size</th><th>Country</th></tr><tr><td>Junk</td><td>March 26</td><td>25KB</td><td>US</td></tr></tbody></table>",
111+
sanitized);
112+
}
104113
}

0 commit comments

Comments
 (0)