fix(gateway): Apply markdown-to-mrkdwn conversion in edit_message#5568
Closed
jarvisxyz wants to merge 1 commit into
Closed
fix(gateway): Apply markdown-to-mrkdwn conversion in edit_message#5568jarvisxyz wants to merge 1 commit into
jarvisxyz wants to merge 1 commit into
Conversation
14fe602 to
543270f
Compare
The edit_message method was sending raw content directly to Slack's chat_update API without converting standard markdown to Slack's mrkdwn format. This caused broken formatting and malformed URLs (e.g., trailing ** from bold syntax became part of clickable links → 404 errors). The send() method already calls format_message() to handle this conversion, but edit_message() was bypassing it. This change ensures edited messages receive the same markdown → mrkdwn transformation as new messages. Closes: PR NousResearch#5558 formatting issue where links had trailing markdown syntax.
543270f to
68c0f2f
Compare
3 tasks
Contributor
|
Merged via PR #5733. Your commit was cherry-picked with authorship preserved. Thanks @jarvisxyz! |
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
Fixes missing markdown → mrkdwn conversion in
edit_message(), causing broken formatting and malformed URLs when editing messages.Problem
The
send()method in the Slack adapter correctly converts standard markdown to Slack'smrkdwnformat usingformat_message(). However,edit_message()was sending raw content directly tochat_update, skipping this conversion.Impact
**text**rendered literally instead of text[link](https://...)in bold/context became<https://...|link>**with trailing**included in the clickable URL → 404 errorsThis was discovered after PR #5558 links were unclickable due to trailing
**from bold syntax becoming part of the URL.Solution
Added
format_message(content)call inedit_message()before sending tochat_update, matching the behavior ofsend().Changes
gateway/platforms/slack.py: Addedformat_message()call inedit_message()Testing
All 69 Slack gateway tests pass. The existing test suite validates the
format_message()function; this fix ensuresedit_message()uses it consistently withsend().Backwards Compatibility
Fully backwards compatible — only fixes broken behavior. Edited messages will now render correctly instead of showing raw markdown.