1234567891011121314151617181920212223242526272829303132 |
- export function decodeNumericCharacterReference(value, base) {
- const code = Number.parseInt(value, base);
- if (
-
- code < 9 || code === 11 || code > 13 && code < 32 ||
-
- code > 126 && code < 160 ||
-
- code > 55_295 && code < 57_344 ||
-
- code > 64_975 && code < 65_008 ||
- (code & 65_535) === 65_535 || (code & 65_535) === 65_534 ||
-
- code > 1_114_111) {
- return "\uFFFD";
- }
- return String.fromCodePoint(code);
- }
|