Skip to main content

escapeHTML

API Docs


Function: escapeHTML()

Call Signature

escapeHTML(str): HTMLSafeString

Defined in: src/utilities/sanitizer.ts:31

Escapes HTML characters in a string to prevent XSS attacks.

Parameters

str

string

The string to escape.

Returns

HTMLSafeString

  • The escaped string, or the input if it was null/undefined.

Call Signature

escapeHTML(str): HTMLSafeString | null

Defined in: src/utilities/sanitizer.ts:32

Escapes HTML characters in a string to prevent XSS attacks.

Parameters

str

The string to escape.

string | null

Returns

HTMLSafeString | null

  • The escaped string, or the input if it was null/undefined.

Call Signature

escapeHTML(str): HTMLSafeString | undefined

Defined in: src/utilities/sanitizer.ts:33

Escapes HTML characters in a string to prevent XSS attacks.

Parameters

str

The string to escape.

string | undefined

Returns

HTMLSafeString | undefined

  • The escaped string, or the input if it was null/undefined.

Call Signature

escapeHTML(str): HTMLSafeString | null | undefined

Defined in: src/utilities/sanitizer.ts:34

Escapes HTML characters in a string to prevent XSS attacks.

Parameters

str

The string to escape.

string | null | undefined

Returns

HTMLSafeString | null | undefined

  • The escaped string, or the input if it was null/undefined.