Socket
Socket
Sign inDemoInstall

markdown-escapes

Package Overview
Dependencies
0
Maintainers
1
Versions
7
Alerts
File Explorer

Advanced tools

Install Socket

Detect and block malicious and high-risk dependencies

Install

    markdown-escapes

List of escapable characters in markdown


Version published
Weekly downloads
2.4M
increased by4.5%
Maintainers
1
Install size
5.49 kB
Created
Weekly downloads
 

Package description

What is markdown-escapes?

The markdown-escapes package is designed to help with escaping and unescaping characters in Markdown text. It provides a straightforward API for handling characters that have special meanings in Markdown syntax, making it easier to work with Markdown programmatically. This can be particularly useful when generating Markdown content dynamically or when processing and sanitizing user-generated Markdown content.

What are markdown-escapes's main functionalities?

Escaping Markdown characters

This feature allows you to escape special Markdown characters in a string, preventing them from being interpreted as Markdown syntax. This is useful when you want to display these characters as plain text in a Markdown document.

const markdownEscapes = require('markdown-escapes');
const text = 'Markdown *text* with special characters';
const escapedText = markdownEscapes.escape(text);
console.log(escapedText);

Unescaping Markdown characters

This feature enables you to unescape previously escaped Markdown characters in a string, allowing them to be interpreted as Markdown syntax again. This can be useful when processing or transforming Markdown content that has been escaped for storage or transmission.

const markdownEscapes = require('markdown-escapes');
const escapedText = 'Markdown \*text\* with special characters';
const unescapedText = markdownEscapes.unescape(escapedText);
console.log(unescapedText);

Other packages similar to markdown-escapes

Readme

Source

markdown-escapes Build Status Coverage Status

List of escapable characters in markdown.

Installation

npm:

npm install markdown-escapes

Usage

var escapes = require('markdown-escapes');

// Access by property:
escapes.commonmark; //=> ['\\', '`', ..., '@', '^']

// Access by options object:
escapes({gfm: true}); //=> ['\\', '`', ..., '~', '|']

API

escapes([options])

Get escapes. Supports options.commonmark and options.gfm, which when true returns the extra escape characters supported by those flavours.

Returns

Array.<string>.

escapes.default

List of default escapable characters.

escapes.gfm

List of escapable characters in GFM (which includes all defaults).

escapes.commonmark

List of escapable characters in CommonMark (which includes all gfms).

License

MIT © Titus Wormer

Keywords

FAQs

Last updated on 12 Jul 2017

Did you know?

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

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc