Package com.scroogexhtml.css
Class CssValueSanitizer
java.lang.Object
com.scroogexhtml.css.CssValueSanitizer
Validation for the one inline-CSS value that carries free text taken from the
RTF stream: the
font-family name (from the RTF font table, including
any Unicode-keyword characters inside a font-table entry).
All other inline-style values the converter emits are structurally safe: colors
are #rrggbb produced by the color-table builder (or an
integrator-supplied default), lengths are numbers converted from twips, and the
remaining declarations are fixed keywords. Only the font name needs an
allow-list, so that a hostile name cannot inject additional declarations or a
url(...) / expression(...) construct into the style
attribute.
-
Method Summary
-
Method Details
-
sanitizeFontFamily
- Parameters:
value- the raw font name- Returns:
value(trimmed) if it is a safefont-familyvalue, otherwise""(the declaration is then dropped)
-