odysseus
Values
pub fn unescape(escaped: String) -> String
Unescapes a string by converting HTML entities back to their original characters.
JavaScript
Browser (main target)
In the browser, this function uses the DOMParser to parse the string as HTML and extract the text content, this means all HTML entities will be converted back to their original characters exhaustively.
Node.js/Deno/Bun
In Node.js, Deno, or Bun, this function will convert:
>to><to<"to"'to'&to&©to©®to®€to€£to£¢to¢°to°•to•·to·–to–—to—‘to'’to'‚to‚„to„…to…™to™ toa non-breaking space character.
Erlang
On the BEAM, this function will convert:
>to><to<"to"'to'&to&“to"”to"©to©®to®€to€£to£¢to¢°to°•to•·to·–to–—to—‘to'’to'‚to‚„to„…to…™to™ toa non-breaking space character.
If you need to unescape a string that contains other HTML entities, please create an issue!