html-to-mrkdwn
Convert HTML to Slack's mrkdwn format.
Usage
const 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>`
Parameters
The module exports a function that takes the following parameters:
Parameter | Type | Description |
---|---|---|
html |
string |
Required HTML string |
flavor |
string |
Optional application-specific HTML flavor |
options |
object |
Optional flavor options |
Flavors
Application-specific HTML flavors are supported by including an optional second argument. Supported flavors include:
github
jira
Options
Option | Type | Example | Description |
---|---|---|---|
jiraBaseUrl |
string |
https://subdomain.atlassian.com |
Jira base URL used to generate absolute attachment links |