decodeHtml
function decodeHtml(value: string): string;
Decimal (<) and hexadecimal (<) references are decoded. Named entities are not: "&" comes back unchanged, because this is the inverse of encodeHtml, which only ever emits numeric references.
Parameters
Parameter | Type | Description |
|---|---|---|
|
| The string to convert. It must not be empty. |
Returns
string — the decoded string.
Throws
Exception | Condition |
|---|---|
| the value is not a string, or is empty. |
Examples
Converting
decodeHtml("<a>"); // => "<a>"
decodeHtml("&"); // => "&"
See also
Source
23 September 2026
This documentation was generated with AI (Claude) from the library's source code.