html-mrkdwn-lite
v0.1.0-beta3
Published
A lightweight HTML to Slack mrkdwn converter
Downloads
7
Readme
html-mrkdwn-lite
A lightweight HTML to Slack mrkdwn converter.
Uses the zero-dependency dom-parser package.
Installation
npm install html-mrkdwn-lite
Usage
import { convert } from 'html-mrkdwn-lite';
const html = `<p><strong>Hello</strong> <a href="https://example.com">world</a>!</p>
<p><img src="https://media.giphy.com/media/5xtDarEbygs3Pu7p3jO/giphy.gif"></p>`
const output = convert(html);
// {
// text: "*Hello* <https://example.com|world>!",
// image: "https://media.giphy.com/media/5xtDarEbygs3Pu7p3jO/giphy.gif",
// }
Contributing
Issues and pull requests are welcome!