Options
All
  • Public
  • Public/Protected
  • All
Menu

Class HTML

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

Added: R15

Examples

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

Hierarchy

  • HTML

Index

Methods

Methods

Static escape

  • escape(string: string): string
  • Escape HTML entities in a string to be HTML safe.

    Parameters

    • string: string

      the string to escape

    Returns string

Static unescape

  • unescape(string: string): string
  • Unescape HTML entities in a string.

    Parameters

    • string: string

      the string to unescape

    Returns string

Generated using TypeDoc