Skip to content

Commit 248c63e

Browse files
committed
Fixed JSON escapes to match JSON, not JavaScript
1 parent 852b613 commit 248c63e

File tree

1 file changed

+4
-6
lines changed

1 file changed

+4
-6
lines changed

bin/ucd_to_json.mts

Lines changed: 4 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -8,18 +8,16 @@ import { fileURLToPath } from "url";
88
const __filename = fileURLToPath(import.meta.url);
99
const __dirname = path.dirname(__filename);
1010

11-
// from https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Lexical_grammar#escape_sequences
11+
// from https://datatracker.ietf.org/doc/html/rfc8259#section-7
1212
const jsonEscape: { [key: string]: string } = {
13-
"0000": "\\0",
14-
"0027": "\\'",
1513
"0022": '\\"',
1614
"005C": "\\\\",
15+
"002F": "\\/",
16+
"0008": "\\b",
17+
"000C": "\\f",
1718
"000A": "\\n",
1819
"000D": "\\r",
19-
"000B": "\\v",
2020
"0009": "\\t",
21-
"0008": "\\b",
22-
"000c": "\\f",
2321
};
2422

2523
const htmlUnsafe = new Set<String>([

0 commit comments

Comments
 (0)