mazey
    Preparing search index...

    Function escapeHTML

    • Escape ampersands, angle brackets, quotes, and forward slashes as HTML entities.

      This performs character escaping only. It does not sanitize arbitrary HTML, validate URLs, or make every HTML, JavaScript, or CSS context safe.

      Usage:

      import { escapeHTML } from "mazey";

      const ret = escapeHTML("<div>hello world</div>");
      console.log(ret);

      Output:

      &lt;div&gt;hello world&lt;&#x2F;div&gt;
      

      Parameters

      • input: string

        The string to escape.

      Returns string

      The escaped string.