clean-jsdoc-theme TypeDoc APIv0.0.0

escapeHtml

escapeHtml(str: string): string

Source: string.ts:212

Escapes HTML special characters in a string

Parameters

  • str (string) — The input string

Returns

  • string — String with HTML characters escaped

Example

CODE
escapeHtml('<script>alert("xss")</script>')
// '&lt;script&gt;alert(&quot;xss&quot;)&lt;/script&gt;'