Skip to content

integrations/html-to-mrkdwn

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

32 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

html-to-mrkdwn

Convert HTML to Slack's mrkdwn format.

const mrkdwn = require('html-to-mrkdwn')

const html = `
<p><strong>Hello</strong> <a href="proxy.php?url=https%3A%2F%2Fexample.com">cruel</a> <em>world</em>!</p>

<p><img src="proxy.php?url=https%3A%2F%2Fmedia.giphy.com%2Fmedia%2F5xtDarEbygs3Pu7p3jO%2Fgiphy.gif"></p>
`

mrkdwn(html)
// {
//   text: "*Hello* <https://example.com|cruel> _world_!\n\n<https://media.giphy.com/media/5xtDarEbygs3Pu7p3jO/giphy.gif>",
//   image: "https://media.giphy.com/media/5xtDarEbygs3Pu7p3jO/giphy.gif",
// }

Greenkeeper badge

About

Convert HTML to Slack's mrkdwn format

Resources

Stars

Watchers

Forks

Packages

 
 
 

Contributors