You're Invited:Meet the Socket Team at BlackHat and DEF CON in Las Vegas, Aug 4-6.RSVP
Socket
Book a DemoInstallSign in
Socket

micromark-util-decode-numeric-character-reference

Package Overview
Dependencies
Maintainers
1
Versions
6
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

micromark-util-decode-numeric-character-reference

micromark utility to decode numeric character references

2.0.2
latest
Source
npmnpm
Version published
Weekly downloads
10M
3.44%
Maintainers
1
Weekly downloads
 
Created

What is micromark-util-decode-numeric-character-reference?

The micromark-util-decode-numeric-character-reference package is a utility for decoding numeric character references in HTML. It is part of the micromark suite of tools for parsing and processing Markdown and HTML content.

What are micromark-util-decode-numeric-character-reference's main functionalities?

Decode Numeric Character References

This feature allows you to decode numeric character references (e.g., 😀) into their corresponding characters (e.g., 😀). The code sample demonstrates decoding a hexadecimal numeric character reference.

const decode = require('micromark-util-decode-numeric-character-reference');

const input = '😀';
const output = decode(input);
console.log(output); // 😀

Handle Invalid References Gracefully

This feature ensures that invalid numeric character references are handled gracefully by returning a replacement character (�). The code sample demonstrates decoding an invalid hexadecimal numeric character reference.

const decode = require('micromark-util-decode-numeric-character-reference');

const input = '&#xZZZZ;';
const output = decode(input);
console.log(output); // �

Other packages similar to micromark-util-decode-numeric-character-reference

Keywords

micromark

FAQs

Package last updated on 12 Nov 2024

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts