CoolFace
Datasetpublic

basant307/AI_Governance_Project

sourceHugging Faceapache-2.0updated 2mo agoView on Hugging Face
0likes48downloads
1# character-reference-invalid2 3[![Build][build-badge]][build]4[![Coverage][coverage-badge]][coverage]5[![Downloads][downloads-badge]][downloads]6[![Size][size-badge]][size]7 8Map of invalid numeric character references to their replacements, according to9HTML.10 11## Contents12 13*   [What is this?](#what-is-this)14*   [When should I use this?](#when-should-i-use-this)15*   [Install](#install)16*   [Use](#use)17*   [API](#api)18    *   [`characterReferenceInvalid`](#characterreferenceinvalid)19*   [Source](#source)20*   [Types](#types)21*   [Compatibility](#compatibility)22*   [Security](#security)23*   [Related](#related)24*   [Contribute](#contribute)25*   [License](#license)26 27## What is this?28 29This is a map from the [HTML spec][source] of C1 ASCII/Unicode control30characters (which are disallowed by HTML) to the characters those code points31would have in Windows 1252.32For example, U+0080 (Padding Character) maps to `€`, because that’s used for330x80 in Windows 1252.34 35## When should I use this?36 37Probably never, unless you’re dealing with parsing HTML or similar XML-like38things, or in a place where Unicode is not the primary encoding (it is in most39places).40 41## Install42 43This package is [ESM only][esm].44In Node.js (version 12.20+, 14.14+, or 16.0+), install with [npm][]:45 46```sh47npm install character-reference-invalid48```49 50In Deno with [Skypack][]:51 52```js53import {characterReferenceInvalid} from 'https://cdn.skypack.dev/character-reference-invalid@2?dts'54```55 56In browsers with [Skypack][]:57 58```html59<script type="module">60  import {characterReferenceInvalid} from 'https://cdn.skypack.dev/character-reference-invalid@2?min'61</script>62```63 64## Use65 66```js67import {characterReferenceInvalid} from 'character-reference-invalid'68 69console.log(characterReferenceInvalid[0x80]) // => '€'70console.log(characterReferenceInvalid[0x89]) // => '‰'71console.log(characterReferenceInvalid[0x99]) // => '™'72```73 74## API75 76This package exports the following identifiers: `characterReferenceInvalid`.77There is no default export.78 79### `characterReferenceInvalid`80 81`Record<number, string>` — mapping between invalid numeric character reference82codes to replacements characters.83 84## Source85 86See [`html.spec.whatwg.org`][source].87 88## Types89 90This package is fully typed with [TypeScript][].91 92## Compatibility93 94This package is at least compatible with all maintained versions of Node.js.95As of now, that is Node.js 12.20+, 14.14+, and 16.0+.96It also works in Deno and modern browsers.97 98## Security99 100This package is safe.101 102## Related103 104*   [`wooorm/character-entities`](https://github.com/wooorm/character-entities)105    — HTML character entity info106*   [`wooorm/character-entities-html4`](https://github.com/wooorm/character-entities-html4)107    — HTML 4 character entity info108*   [`wooorm/character-entities-legacy`](https://github.com/wooorm/character-entities-legacy)109    — legacy character entity info110*   [`wooorm/parse-entities`](https://github.com/wooorm/parse-entities)111    — parse HTML character references112*   [`wooorm/stringify-entities`](https://github.com/wooorm/stringify-entities)113    — serialize HTML character references114 115## Contribute116 117Yes please!118See [How to Contribute to Open Source][contribute].119 120## License121 122[MIT][license] © [Titus Wormer][author]123 124<!-- Definitions -->125 126[build-badge]: https://github.com/wooorm/character-reference-invalid/workflows/main/badge.svg127 128[build]: https://github.com/wooorm/character-reference-invalid/actions129 130[coverage-badge]: https://img.shields.io/codecov/c/github/wooorm/character-reference-invalid.svg131 132[coverage]: https://codecov.io/github/wooorm/character-reference-invalid133 134[downloads-badge]: https://img.shields.io/npm/dm/character-reference-invalid.svg135 136[downloads]: https://www.npmjs.com/package/character-reference-invalid137 138[size-badge]: https://img.shields.io/bundlephobia/minzip/character-reference-invalid.svg139 140[size]: https://bundlephobia.com/result?p=character-reference-invalid141 142[npm]: https://docs.npmjs.com/cli/install143 144[skypack]: https://www.skypack.dev145 146[license]: license147 148[author]: https://wooorm.com149 150[esm]: https://gist.github.com/sindresorhus/a39789f98801d908bbc7ff3ecc99d99c151 152[typescript]: https://www.typescriptlang.org153 154[contribute]: https://opensource.guide/how-to-contribute/155 156[source]: https://html.spec.whatwg.org/multipage/parsing.html#table-charref-overrides157 
basant307/AI_Governance_Project · CoolFace