-
Notifications
You must be signed in to change notification settings - Fork 228
Closed
Description
Problem
When posting messages with content_type: "text/markdown", multiline fenced code blocks are incorrectly rendered as separate inline code snippets instead of a single code block.
Example
Input markdown:
```
foo
bar
```
Expected: A single multiline code block in Slack
Actual: Two separate inline code snippets: foo bar
Root Cause
The upstream library github.com/takara2314/slack-go-util (v0.2.0) incorrectly converts fenced code blocks.
- Current behavior: Uses
RichTextSectionwithstyle: {code: true}which creates inline code formatting - Correct behavior: Should use
RichTextPreformattedwhich creates proper preformatted code blocks
Location in this codebase
pkg/handler/conversations.go:174:
blocks, err := slackGoUtil.ConvertMarkdownTextToBlocks(params.text)Fix
PR submitted to upstream: takara2314/slack-go-util#1
Workaround
Until the upstream fix is merged and a new version released, users can:
- Use
content_type: "text/plain"and format code blocks manually using Slack's mrkdwn syntax - Or pin to a fork with the fix applied
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
No labels