feat(slack): use native markdown_text for outgoing messages#440
Merged
Conversation
Contributor
|
@raimondlume is attempting to deploy a commit to the Vercel Team on Vercel. A member of the Team first needs to authorize it. |
dancer
approved these changes
May 5, 2026
Slack now natively renders markdown via the `markdown_text` parameter on
chat.postMessage / postEphemeral / update / scheduleMessage and via
response_url payloads. The adapter passes markdown through directly instead
of converting to mrkdwn.
- Tables, headings, code fences, blockquotes, and nested lists render
natively in Slack instead of falling back to ASCII / mrkdwn.
- `string` and `{ raw }` messages still go to `text` (preserves literal `*`).
- `{ markdown }` and `{ ast }` messages go to `markdown_text` (12k char limit).
- `renderWithTableBlocks`, `toBlocksWithTable`, `mdastTableToSlackBlock`,
and the AST→mrkdwn renderer (`fromAst` / `nodeToMrkdwn`) are removed.
- `SlackMarkdownConverter` alias is removed; use `SlackFormatConverter`.
- `renderFormatted(ast)` now returns standard markdown (was mrkdwn).
- Incoming `message` events still arrive as mrkdwn and are parsed unchanged.
Net -473 lines across markdown.ts and the five sender call sites.
82b4c9c to
f33bea3
Compare
5 tasks
This was referenced May 29, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Slack now natively supports markdown via the
markdown_textfield onchat.postMessage/postEphemeral/update/scheduleMessage. Previously the adapter converted outgoing markdown to mrkdwn and synthesized Block Kittableblocks (with ASCII fallback) to work around mrkdwn's lack of table support.This PR passes markdown straight through on the Slack Web API methods that support
markdown_text. Tables, headings, fenced code blocks, blockquotes, and nested lists now render natively in those Slack messages instead of degrading.Interactive
response_urlpayloads are the one exception: e2e testing showed Slack rejectsmarkdown_textthere with{"ok":false,"error":"no_text"}, so response_url edits intentionally keep a small mrkdwn text fallback.Builds on my prev PR #349, which started using Slack's native markdown rendering for streamed tables.
What changes
{ markdown }and{ ast }messages on Slack Web API methods ->markdown_textfieldresponse_urledits -> mrkdwntextfallbackstringand{ raw }messages -> stilltext(preserves literal*/_)SlackMarkdownConverteralias (useSlackFormatConverter)renderFormatted(ast)now returns standard markdown instead of mrkdwnmessageevents are still parsed as mrkdwn — unchangedTest plan
toSlackPayload, response_url fallback rendering, and response_url edit payloadspackages/integration-tests/src/slack.test.ts) updated formarkdown_textwire formatpnpm --filter @chat-adapter/slack typecheckpnpm checkpnpm --filter @chat-adapter/slack buildmarkdown_text; response_url fallback uses mrkdwntextBefore / after screenshots:
