🔓 Unescapes HTML entities back to their original characters.

Syntax

TypeScript
import { unescapeHTML } from '@opentf/std';
unescapeHTML(str: string): string;

Returns

The unescaped string.

Supports both ' and ' for apostrophes.

Examples

TypeScript
unescapeHTML('<script>alert("xss")</script>')
//=> '<script>alert("xss")</script>'
Last updated on
Edit this page