html-mrkdwn-lite
TypeScript icon, indicating that this package has built-in type declarations

0.1.0-beta3 • Public • Published

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!

Readme

Keywords

Package Sidebar

Install

npm i html-mrkdwn-lite

Weekly Downloads

3

Version

0.1.0-beta3

License

ISC

Unpacked Size

6.8 kB

Total Files

4

Last publish

Collaborators

  • elson23