Class InlineStyleCleaner


public class InlineStyleCleaner extends AttributeCleaner
Clean HTML style attribute using a whitelist of authorized css properties.
Since:
jcms-10.0.0 / JCMS-6170
  • Constructor Details

    • InlineStyleCleaner

      public InlineStyleCleaner()
      Build a new cleaner
  • Method Details

    • cleanSingleValue

      protected String cleanSingleValue(String cssProperty)
      Description copied from class: AttributeCleaner
      Clean individual value of the attribute.

      When attributes accept several values (such as "class" attribute), this method is invoked for each of this value.
      When attributes accept only one value (such as "id" attribute), this method is invoked one for the whole attribute value.

      Override to provide custom cleaning behavior.

      Overrides:
      cleanSingleValue in class AttributeCleaner
      Parameters:
      cssProperty - the unsafe attribute value (or "split" value in case multiple values)
      Returns:
      a safe sanitized value (or empty string if no value was kept, never return null)