transpile-md converts Github-flavored markdown to a target output such as HTML, Slack, Discord, or Telegram.
npm install transpile-md
yarn add transpile-md
const transpileMd = require('transpile-md');
const markdown = `
**List of items**
* item 1
* item 2
* item 3
[here is an example](https://example.com)
`;
transpileMd(markdown, { target: 'slack' });
/*
*List of items*
• item 1
• item 2
• item 3
<https://example.com|here is an example>
/*
Required - valid values include:
- html (standard HTML)
- slack (Slack-flavored Markdown (mrkdwn))
- telegram (Telegram-flavored Markdown)
- discord (Discord-flavored Markdown)
- transparent-links (input markdown without opaque anchor text on links (e.g.
[my link](http://example.com)
=>my link ([http://example.com](http://example.com))
))
HTML can be highlighted by assigning valid rehype-highlight options to the options.highlight
parameter.
This is only valid with target: html
. It will be ignored for other targets.
Credit to slackify-markdown for providing the basis for this package.