Home > @infiniteobjects/core-library-node > Html > sanitize
Sanitize html string
Signature:
static sanitize(html: string, makeLinksExternal?: boolean): string;
| Parameter | Type | Description |
|---|---|---|
| html | string | HTML string to sanitize |
| makeLinksExternal | boolean | (Optional) Make all non relative links in html string open in a new tab |
Returns:
string
Will strip out everything that contains dangerous HTML and thereby prevent XSS attacks and other nastiness.