Function escapeAttribute

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

  • Parameters

    • data: string

      String to escape.

    Returns string