Helper methods to escape and unescape HTML entities in a string.

Example

let s = "<One> & Two";
let escaped = HTML.escape(s); // "&#x3C;One&#x3E &#x26; Two"
let unescaped = HTML.unescape(encoded); // "<One> & Two"

Hierarchy

  • HTML

Constructors

Methods

Constructors

Methods

  • Escape HTML entities in a string to be HTML safe.

    Parameters

    • string: string

      the string to escape

    Returns string

  • Unescape HTML entities in a string.

    Parameters

    • string: string

      the string to unescape

    Returns string

Generated using TypeDoc