Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

micromark-util-decode-numeric-character-reference

Package Overview
Dependencies
Maintainers
1
Versions
5
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

  • 1.0.0-beta.1
  • next
  • Source
  • npm
  • Socket score

Version published
Maintainers
1
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

FAQs

Package last updated on 20 Jun 2021

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

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc