Class HtmlSanitizer

java.lang.Object
org.iplass.mtp.entity.definition.NormalizerDefinition
org.iplass.mtp.entity.definition.normalizers.HtmlSanitizer
All Implemented Interfaces:
Serializable

public class HtmlSanitizer extends NormalizerDefinition
Normalizer definition for HTML sanitization. Removes HTML elements and attributes that are not allowed, converting to safe HTML. Primarily intended for server-side sanitization of HTML input from RichText editors.

Select a jsoup Safelist preset via SafelistType.

If customizeScript is specified, the Safelist object created from the selected preset can be customized via a Groovy script. The binding variable safelist (org.jsoup.safety.Safelist) is available in the script.

See Also:
  • Constructor Details

    • HtmlSanitizer

      public HtmlSanitizer()
    • HtmlSanitizer

      public HtmlSanitizer(SafelistType safelistType)
  • Method Details

    • getSafelistType

      public SafelistType getSafelistType()
    • setSafelistType

      public void setSafelistType(SafelistType safelistType)
    • getCustomizeScript

      public String getCustomizeScript()
    • setCustomizeScript

      public void setCustomizeScript(String customizeScript)