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

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

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