Skip to content

unescapeHtml ​

Unescapes HTML entities.

unescapeHtml ​

Signature ​

typescript
function unescapeHtml(str: string): string

Parameters ​

  • str - The string to unescape

Returns ​

String with HTML entities decoded.

Examples ​

typescript
import { unescapeHtml } from 'strio'

unescapeHtml('<div>Hello & goodbye</div>')
// "<div>Hello & goodbye</div>"

unescapeHtml('5 &gt; 3')
// "5 > 3"

See Also ​

Released under the MIT License.