Big update!Introducing GitHub Bot Commands. Learn more
Socket
Log inBook a demo

character-reference-invalid

Package Overview
Dependencies
0
Maintainers
1
Versions
9
Issues
File Explorer

Advanced tools

character-reference-invalid

Map of invalid numeric character references to their replacements, according to HTML

    2.0.1latest

Version published
Maintainers
1
Weekly downloads
5,805,483
decreased by-18.59%

Weekly downloads

Changelog

Source

2.0.1

  • 5f1eb4a Update docs
  • 2a15522 Add strict types

Full Changelog: https://github.com/wooorm/character-reference-invalid/compare/2.0.0...2.0.1

Readme

Source

character-reference-invalid

Build Coverage Downloads Size

Map of invalid numeric character references to their replacements, according to HTML.

Contents

What is this?

This is a map from the HTML spec of C1 ASCII/Unicode control characters (which are disallowed by HTML) to the characters those code points would have in Windows 1252. For example, U+0080 (Padding Character) maps to , because that’s used for 0x80 in Windows 1252.

When should I use this?

Probably never, unless you’re dealing with parsing HTML or similar XML-like things, or in a place where Unicode is not the primary encoding (it is in most places).

Install

This package is ESM only. In Node.js (version 12.20+, 14.14+, or 16.0+), install with npm:

npm install character-reference-invalid

In Deno with Skypack:

import {characterReferenceInvalid} from 'https://cdn.skypack.dev/character-reference[email protected]2?dts'

In browsers with Skypack:

<script type="module"> import {characterReferenceInvalid} from 'https://cdn.skypack.dev/[email protected]?min' </script>

Use

import {characterReferenceInvalid} from 'character-reference-invalid' console.log(characterReferenceInvalid[0x80]) // => '€' console.log(characterReferenceInvalid[0x89]) // => '‰' console.log(characterReferenceInvalid[0x99]) // => '™'

API

This package exports the following identifiers: characterReferenceInvalid. There is no default export.

characterReferenceInvalid

Record<number, string> — mapping between invalid numeric character reference codes to replacements characters.

Source

See html.spec.whatwg.org.

Types

This package is fully typed with TypeScript.

Compatibility

This package is at least compatible with all maintained versions of Node.js. As of now, that is Node.js 12.20+, 14.14+, and 16.0+. It also works in Deno and modern browsers.

Security

This package is safe.

Contribute

Yes please! See How to Contribute to Open Source.

License

MIT © Titus Wormer

Keywords

FAQs

What is character-reference-invalid?

Map of invalid numeric character references to their replacements, according to HTML

Is character-reference-invalid popular?

The npm package character-reference-invalid receives a total of 4,883,027 weekly downloads. As such, character-reference-invalid popularity was classified as popular.

Is character-reference-invalid well maintained?

We found that character-reference-invalid demonstrated a not healthy version release cadence and project activity because the last version was released a year ago.It has 1 open source maintainer collaborating on the project.

Last updated on 27 Oct 2021

Did you know?

Socket installs a Github app to automatically flag issues on every pull request and report the health of your dependencies. Find out what is inside your node modules and prevent malicious activity before you update the dependencies.

Install Socket
Socket

Product

Subscribe to our newsletter

Get open source security insights delivered straight into your inbox. Be the first to learn about new features and product updates.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc