Decode HTML numeric and named entities to their UTF-8 characters. Converts ä โ รค, ä โ รค, & โ &, etc.
Use this to normalize text extracted from HTML before further processing, preventing double-escaping when the text is later passed through escapeHtml().
Parameters
text: string
Text potentially containing HTML entities
Returns string
Text with entities decoded to UTF-8; empty string for falsy input
Decode HTML numeric and named entities to their UTF-8 characters. Converts
äโรค,äโรค,&โ&, etc.Use this to normalize text extracted from HTML before further processing, preventing double-escaping when the text is later passed through escapeHtml().