From 9b6e5f6a04996a936d08ad0b3f3ccfd6cc3e9384 Mon Sep 17 00:00:00 2001 From: eizus Date: Mon, 6 Apr 2026 11:59:54 -0400 Subject: [PATCH] fix(gateway): Apply markdown-to-mrkdwn conversion in edit_message MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 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 #5558 formatting issue where links had trailing markdown syntax. --- gateway/platforms/slack.py | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/gateway/platforms/slack.py b/gateway/platforms/slack.py index 2e7bbee73..b4bf5ffd7 100644 --- a/gateway/platforms/slack.py +++ b/gateway/platforms/slack.py @@ -276,10 +276,13 @@ class SlackAdapter(BasePlatformAdapter): if not self._app: return SendResult(success=False, error="Not connected") try: + # Convert standard markdown → Slack mrkdwn + formatted = self.format_message(content) + await self._get_client(chat_id).chat_update( channel=chat_id, ts=message_id, - text=content, + text=formatted, ) return SendResult(success=True, message_id=message_id) except Exception as e: # pragma: no cover - defensive logging