deno.land / std@0.224.0 / html / _tools / generate_data.ts

generate_data.ts
View Documentation
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
#!/usr/bin/env -S deno run --allow-net --allow-read --allow-write// Copyright 2018-2024 the Deno authors. All rights reserved. MIT license.
// JSON version of the full canonical list of named HTML entities// https://html.spec.whatwg.org/multipage/named-characters.htmlimport entityList from "https://html.spec.whatwg.org/entities.json" with { type: "json",};
const data = Object.fromEntries( Object.entries(entityList).map(([k, v]) => [k, v.characters]),);
await Deno.writeTextFile( new URL(import.meta.resolve("../named_entity_list.json")), JSON.stringify(data, null, 2) + "\n",);
std

Version Info

Tagged at
4 months ago