entities 9.0.0
function encodeHTML(input: string): string

Defined in encode.ts:176

Encodes all characters in the input using HTML entities. This includes characters that are valid ASCII characters in HTML documents, such as #.

To get a more compact output, consider using the encodeNonAsciiHTML function, which will only encode characters that are not valid in HTML documents, as well as non-ASCII characters.

If a character has no equivalent entity, a numeric decimal reference (eg. ü) will be used.

Parameters

input: string

Input string to encode.

Returns

string