Skip to content
Browse files

added tests for CDO and CDC now that we have changed how dashes are a…

…llowed in font names
  • Loading branch information...
mikesamuel committed May 12, 2017
1 parent 1f3b688 commit c88cb4789a70e9ac1a78edf3c7935e8e67957584
Showing with 9 additions and 0 deletions.
  1. +9 −0 src/test/java/org/owasp/html/
@@ -335,6 +335,15 @@ public static final void testImportant() {
"color:purple !foo(bar) important");

public static final void testCdoCdc() {
// No <!-- or --> in output.
assertSanitizedCss("font-family:'a--' 'b'", "font-family: a--\\>b");
assertSanitizedCss("font-family:'a' '--b'", "font-family: a<\\!--b");
assertSanitizedCss("font-family:'a--' 'b'", "font-family: a-->b");
assertSanitizedCss("font-family:'a b'", "font-family: a<!--b");

private static void assertSanitizedCss(
@Nullable String expectedCss, String css) {
StylingPolicy stylingPolicy = new StylingPolicy(

0 comments on commit c88cb47

Please sign in to comment.
You can’t perform that action at this time.