Function escapeText

Encodes all characters that have to be escaped in HTML text, following https://html.spec.whatwg.org/multipage/parsing.html#escapingString.

  • Parameters

    • data: string

      String to escape.

    Returns string