escapeHtml
Escapes HTML special characters.
escapeHtml
Signature
typescript
function escapeHtml(str: string): stringParameters
str- The string to escape
Returns
String with HTML characters escaped.
Examples
typescript
import { escapeHtml } from 'strio'
escapeHtml('<div>Hello & "goodbye"</div>')
// "<div>Hello & "goodbye"</div>"
escapeHtml('5 > 3')
// "5 > 3"Related Functions
- unescapeHtml - Unescape HTML
- escapeRegExp - Escape regex characters
- stripTags - Remove HTML tags