Closed
Description
I am sanitazing the input using the default CssSchema and discovered that xxx-large font size is not supported in allowed font-sizes in styling
ImmutableSet<String> fontLiterals1 = ImmutableSet.of(
"large", "larger", "small", "smaller", "x-large", "x-small",
"xx-large", "xx-small");
I tried various ways like
- union of custom CssSchema with just xxx-large font-size along with default CssSchema but it results as
Caused by: java.lang.IllegalArgumentException: Duplicate irreconcilable definitions for font-size
at org.owasp.html.CssSchema.union(CssSchema.java:199)
- I also tried creating customHTMLPolicyBuilder with allowAttributes settings but it seems to be applied after the font-size is removed by CssSchema
CustomerHtmlPolicyBuilder.allowAttributes("style").matching(Pattern.compile("font-size:xxx-large"))
.onElements("span")
please let me know how to proceed with font-size as xxx-large as it's a valid size and supported in various browsers
Example :
String to sanitize:
the <span style="font-size:xxx-large">large</span> formatting issue with chrome
Expected: (same as above as all valid configurations)
the <span style="font-size:xxx-large">large</span> formatting issue with chrome
Actual:
the large formatting issue with chrome
the large formatting issue with chrome
Metadata
Metadata
Assignees
Labels
No labels