Options
All
  • Public
  • Public/Protected
  • All
Menu

A container for HTML content that is not trusted to be safe. Has getters for accessing either the originally-provided unsafe HTML string, or a safely sanitized version. Simplifies XSS security matters by making the handling of unsafe HTML obvious and clear.

Hierarchy

  • UnsafeHtml

Index

Constructors

Properties

Methods

Constructors

constructor

  • Create a new container for unsafe HTML.

    Parameters

    Returns UnsafeHtml

Properties

Protected _safeHtml

_safeHtml: string

The safely sanitized version of the HTML.

Protected _unsafeHtml

_unsafeHtml: string

The unsafe HTML.

safeHtml

safeHtml: string

Get the safely sanitized version of the HTML.

unsafeHtml

unsafeHtml: string

Get the original unsafe HTML.

Methods

sanitize

  • Update the HTML.

    Parameters

    Returns void