import { unescape } from "https://deno.land/std@0.193.0/html/mod.ts";
Unescapes HTML entities in text
Examples
Example 1
Example 1
import { unescape } from "https://deno.land/std@0.193.0/html/entities.ts";
import { assertEquals } from "https://deno.land/std@0.193.0/testing/asserts.ts";
// default options (only handles &<>'" and numeric entities)
assertEquals(unescape("<>'&AA"), "<>'&AA");
assertEquals(unescape("þð"), "þð");
// using the full named entity list from the HTML spec (~47K unminified)
import entityList from "https://deno.land/std@0.193.0/html/named_entity_list.json" assert { type: "json" };
assertEquals(unescape("þð", { entityList }), "þð");
Parameters
optional
options: Partial<UnescapeOptions> = [UNSUPPORTED]