Socket
Book a DemoInstallSign in
Socket

html-to-mrkdwn-ts

Package Overview
Dependencies
Maintainers
1
Versions
2
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

html-to-mrkdwn-ts

Fast HTML to Slack flavored mrkdwn

1.1.0
latest
Source
npmnpm
Version published
Maintainers
1
Created
Source

npm version npm downloads Build Status

html-to-mrkdwn-ts

html-to-mrkdwn-ts is a fast HTML to Slack flavored markdown converter.

Install

<yarn|npm|pnpm> html-to-mrkdwn-ts

Usage

import htmlToMrkdwn from 'html-to-mrkdwn-ts'
const html = `
<div>
  <h1>A Title</h1>
  <a href="https://foo.bar">
    <img src="https://foo.bar/baz.jpg" alt="baz" />
  </a>
</div>`

htmlToMrkdwn(html)

// {
//   image: 'https://foo.bar/baz.jpg',
//   text: '*A Title*\n\n<https://foo.bar|baz>'
// }

Options

under the hood html-to-mrkdwn-ts uses node-html-markdown so you can pass an additional options as a second argument:

htmlToMrkdwn(html, { strongDelimiter: '**' })

see available options

Keywords

html

FAQs

Package last updated on 13 Apr 2022

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

About

Packages

Stay in touch

Get open source security insights delivered straight into your inbox.

  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc

U.S. Patent No. 12,346,443 & 12,314,394. Other pending.