import { unescape } from "https://deno.land/std@0.204.0/html/entities.ts";
Unescapes HTML entities in text
Examples
Example 1
Example 1
import { unescape } from "https://deno.land/std@0.204.0/html/entities.ts";
import { assertEquals } from "https://deno.land/std@0.204.0/assert/assert_equals.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.204.0/html/named_entity_list.json" assert { type: "json" };
assertEquals(unescape("þð", { entityList }), "þð");
Parameters
optional
options: Partial<UnescapeOptions> = [UNSUPPORTED]