API / @aionbuilders/nabu/extend

escapeHtml

Function Stability: stable

Escape text for use as HTML text content OR inside a quoted attribute value (& < > " ').

Signature

TypeScript
import { escapeHtml } from '@aionbuilders/nabu/extend';
TypeScript
function escapeHtml(text: unknown): string

Parameters

Parameters of escapeHtml
ParameterTypeDescription
textunknownn/a

Returns

string

Source: src/lib/utils/html.js:21