Options
All
  • Public
  • Public/Protected
  • All
Menu

Class Sanitizer

A class to sanitize HTML strings.

Hierarchy

  • Sanitizer

Implements

Index

Constructors

constructor

  • Returns Sanitizer

Properties

Private _allowNamedProperties

_allowNamedProperties: any

Private _generateOptions

_generateOptions: any

Private _options

_options: any

Methods

sanitize

  • sanitize(dirty: string, options?: IOptions): string
  • Sanitize an HTML string.

    Parameters

    • dirty: string

      The dirty text.

    • Optional options: IOptions

      The optional sanitization options.

    Returns string

    The sanitized string.

setAllowNamedProperties

  • setAllowNamedProperties(allowNamedProperties: boolean): void
  • Set the whether to allow name and id attributes.

    Parameters

    • allowNamedProperties: boolean

    Returns void

setAllowedSchemes

  • setAllowedSchemes(scheme: string[]): void
  • Set the allowed schemes

    Parameters

    • scheme: string[]

      Allowed schemes

    Returns void

Generated using TypeDoc