goldies
    Preparing search index...

    Function escapeHTML

    • Escape special characters in an HTML string.

      Parameters

      • html: string

        The HTML string to escape.

      Returns string

      The escaped HTML string.

      const html = '<div class="example">Hello & welcome!</div>';
      // returns '&lt;div class=&quot;example&quot;&gt;Hello &amp; welcome!&lt;/div&gt;'
      const escaped = escapeHTML(html);