Converts HTML special characters like &<>"'`’ to & escaped codes or vice versa.
It handles named entities and hexadecimal numeric character references.
Parameters
str: string
The string to process.
unescape: boolean = true
default=true - If true, converts & codes to characters.
If false, converts characters to codes.
Converts HTML special characters like &<>"'`’ to & escaped codes or vice versa. It handles named entities and hexadecimal numeric character references.