Skip to content

Commit c88cb47

Browse files
committed
added tests for CDO and CDC now that we have changed how dashes are allowed in font names
1 parent 1f3b688 commit c88cb47

1 file changed

Lines changed: 9 additions & 0 deletions

File tree

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

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -335,6 +335,15 @@ public static final void testImportant() {
335335
"color:purple !foo(bar) important");
336336
}
337337

338+
@Test
339+
public static final void testCdoCdc() {
340+
// No <!-- or --> in output.
341+
assertSanitizedCss("font-family:'a--' 'b'", "font-family: a--\\>b");
342+
assertSanitizedCss("font-family:'a' '--b'", "font-family: a<\\!--b");
343+
assertSanitizedCss("font-family:'a--' 'b'", "font-family: a-->b");
344+
assertSanitizedCss("font-family:'a b'", "font-family: a<!--b");
345+
}
346+
338347
private static void assertSanitizedCss(
339348
@Nullable String expectedCss, String css) {
340349
StylingPolicy stylingPolicy = new StylingPolicy(

0 commit comments

Comments
 (0)