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

slack-markdown

Package Overview
Dependencies
Maintainers
1
Versions
10
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

slack-markdown

A markdown parser for Slack messages

  • 0.0.1
  • Source
  • npm
  • Socket score

Version published
Weekly downloads
15K
decreased by-4.46%
Maintainers
1
Weekly downloads
 
Created
Source

slack-markdown

Slack-markdown aims to be a markdown parser for slack messages.

Installation

npm install --save slack-markdown

Usage

const { toHTML } = require("slack-markdown");
console.log(toHTML("This *is* a _test_"));
// outputs: This <strong>is</strong> a <em>test</em>

Options

const { toHTML } = require("slack-markdown");
toHTML("This *is* a _test_", options);

options is an object with the following properties (all are optional):

  • escapeHtml: boolean (default: true), if HTML should be escaped or not
  • slackOnly: boolean (default: false), if only slack-specific markdown should be parsed
  • slackCallbacks: Object of the custom slack callbacks
  • user: (id: ID, name: Name) User mentions "<@ID|name>"
  • channel: (id: ID, name: Name) Channel mentions "<#ID|name>"
  • usergroup: (id: ID, name: Name) User group mentions ""
  • atHere: (name: Name) At here mentions ""
  • atChannel: (name: Name) At channel mentions ""
  • atEveryone: (name: Name) At everyone mentions ""
  • date: (timestamp: Timestamp, format: Format, link: Optional link, fallback: fallback string) Date mentions ""
  • cssModuleNames: object, name mapping of CSS classes to custom ones
  • noExtraSpanTags: boolean (default: false) Disable the addition of extra span tags on slack-specific parsing

Keywords

FAQs

Package last updated on 26 Jan 2020

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