$ gnpm install micromark-util-decode-numeric-character-reference
micromark utility to decode numeric character references.
npm:
npm install micromark-util-decode-numeric-character-reference
import {decodeNumericCharacterReference} from 'micromark-util-decode-numeric-character-reference'
decodeNumericCharacterReference('41', 16) // 'A'
decodeNumericCharacterReference('65', 10) // 'A'
decodeNumericCharacterReference('A', 16) // '\n'
decodeNumericCharacterReference('7F', 16) // '�' - Control
decodeNumericCharacterReference('110000', 16) // '�' - Out of range
This module exports the following identifiers:
decodeNumericCharacterReference.
There is no default export.
decodeNumericCharacterReference(value)Sort of like String.fromCharCode(Number.parseInt(value, base)),
but makes non-characters and control characters safe.
value (string) — Value to decode.base (number, probably 10 or 16) — Numeric base.string — Character code.
See security.md in micromark/.github for how to
submit a security report.
See contributing.md in micromark/.github for ways
to get started.
See support.md for ways to get help.
This project has a code of conduct. By interacting with this repository, organisation, or community you agree to abide by its terms.
Copyright 2013 - present © cnpmjs.org | Home |