html-to-mrkdwn

    3.0.0 • Public • Published

    html-to-mrkdwn

    Convert HTML to Slack's mrkdwn format.

    const mrkdwn = require('html-to-mrkdwn')
     
    const html = `
    <p><strong>Hello</strong> <a href="https://example.com">cruel</a> <em>world</em>!</p>
     
    <p><img src="https://media.giphy.com/media/5xtDarEbygs3Pu7p3jO/giphy.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

    Install

    npm i html-to-mrkdwn

    DownloadsWeekly Downloads

    1,528

    Version

    3.0.0

    License

    ISC

    Unpacked Size

    8.21 kB

    Total Files

    31

    Last publish

    Collaborators

    • bkeepers