{"library":"slack-markdown","title":"Slack Message Markdown to HTML Parser","description":"slack-markdown is a JavaScript library designed to parse Slack's specific markdown syntax, known as `mrkdwn`, and convert it into standard HTML. This is crucial for applications that need to display Slack messages outside of the Slack client, as `mrkdwn` differs significantly from CommonMark or GitHub Flavored Markdown. For instance, `mrkdwn` uses single asterisks for bold (`*bold*`) and single underscores for italic (`_italic_`), unlike typical Markdown conventions. The library handles various `mrkdwn` elements, including basic formatting, special mentions (users, channels, user groups), and date mentions, translating them into appropriate HTML tags. It is currently at version 0.3.0. Given its low version number and limited activity, the project appears to be in an abandoned state, meaning there's no ongoing development or regular release cadence. Its key differentiator is its specialized focus on precisely interpreting Slack's unique `mrkdwn` format for HTML output, rather than converting standard Markdown to `mrkdwn` or generating Slack Block Kit JSON payloads.","language":"javascript","status":"abandoned","last_verified":"Sun Apr 19","install":{"commands":["npm install slack-markdown"],"cli":null},"imports":["import { toHTML } from 'slack-markdown';","const { toHTML } = require('slack-markdown');","import type { Options } from 'slack-markdown';"],"auth":{"required":false,"env_vars":[]},"quickstart":{"code":"import { toHTML } from 'slack-markdown';\n\n// Basic conversion of Slack's mrkdwn to HTML\nconst slackMessage1 = \"Hello, *world*! This is a _test_ with ~strikethrough~.\";\nconsole.log('Default conversion:');\nconsole.log(toHTML(slackMessage1));\n// Expected: Hello, <strong>world</strong>! This is a <em>test</em> with <strike>strikethrough</strike>.\n\n// Conversion with custom options, e.g., disabling HTML escaping\nconst slackMessage2 = \"<@U12345678|user> mentioned <#C02ABCDFG|channel>. Priority: <!here|here>!\";\nconst options = {\n  escapeHTML: false, // Be cautious with untrusted input if setting to false\n  slackCallbacks: {\n    user: (id, name) => `<a href=\"https://slack.com/team/${id}\">@${name}</a>`,\n    channel: (id, name) => `<a href=\"https://slack.com/archives/${id}\">#${name}</a>`,\n    atHere: (name) => `<span class=\"mention\">@${name}</span>`\n  }\n};\nconsole.log('\\nCustom callbacks conversion:');\nconsole.log(toHTML(slackMessage2, options));\n// Expected (roughly): <a href=\"https://slack.com/team/U12345678\">@user</a> mentioned <a href=\"https://slack.com/archives/C02ABCDFG\">#channel</a>. Priority: <span class=\"mention\">@here</span>!","lang":"typescript","description":"Demonstrates converting Slack's `mrkdwn` to HTML with default settings and custom callbacks for special mentions.","tag":null,"tag_description":null,"last_tested":null,"results":[]},"compatibility":null}