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.
npm install slack-markdownVerified import paths — ran on the pinned version, not inferred.
Demonstrates converting Slack's `mrkdwn` to HTML with default settings and custom callbacks for special mentions.
Monitor package activity and always test thoroughly when upgrading any pre-1.0.0 library, especially if it appears to be abandoned.
Ensure your input strictly adheres to Slack's `mrkdwn` syntax. If you need to convert standard Markdown to Slack's format, consider a different library like `md-to-slack` or `slack-markdown-it`.
Always keep `escapeHTML: true` (the default) when processing untrusted input. If you must set `escapeHTML: false` for specific trusted scenarios, ensure rigorous input sanitization is performed *before* passing the content to `toHTML`.
For ESM environments, use `import { toHTML } from 'slack-markdown';`. For Node.js ESM projects, ensure your `package.json` specifies `"type": "module"` or use a `.mjs` file extension.Review Slack's `mrkdwn` formatting guidelines. If you intend to send messages *to* Slack, ensure your input follows `mrkdwn` rules. If you're using this library to parse, ensure the input it receives is already in valid `mrkdwn` format.
Always use named imports with destructuring: `import { toHTML } from 'slack-markdown';` (ESM) or `const { toHTML } = require('slack-markdown');` (CommonJS).No dependency data recorded yet.