[PR #1625] [MERGED] feat(slack_bot): support markdown formatting #1995

Closed
opened 2026-02-16 11:15:48 -05:00 by yindo · 0 comments
Owner

📋 Pull Request Information

Original PR: https://github.com/langgenius/dify-official-plugins/pull/1625
Author: @Cluas
Created: 9/1/2025
Status: Merged
Merged: 9/1/2025
Merged by: @crazywoola

Base: mainHead: feat-slack_bot_support_markdown


📝 Commits (2)

  • 018cb3f feat(slack_bot): support markdown formatting
  • f070818 feat(slack_bot): integrate markdown_to_mrkdwn for message formatting

📊 Changes

4 files changed (+23 additions, -9 deletions)

View changed files

📝 extensions/slack_bot/README.md (+1 -1)
📝 extensions/slack_bot/endpoints/slack.py (+18 -5)
📝 extensions/slack_bot/manifest.yaml (+3 -3)
📝 extensions/slack_bot/requirements.txt (+1 -0)

📄 Description

Summary

Enhanced Slack Bot plugin to support proper markdown formatting in messages. The bot now correctly converts standard markdown to Slack's mrkdwn format and uses proper Block Kit structure for rich message display. This is especially important in the era of LLMs, as many large models use markdown responses.

Changes Made

  • use https://github.com/fla9ua/markdown_to_mrkdwn to convert standard markdown syntax to Slack mrkdwn format
  • Updated message sending logic to use Block Kit with proper mrkdwn text type
  • Simplified code by removing complex original blocks manipulation
  • Added support for bold, italic, strikethrough, inline code, links, and code blocks formatting

Technical Details

  • Bold: **text***text*
  • Italic: *text*_text_
  • Strikethrough: ~~text~~~text~
  • Links: [text](url)<url|text>
  • Code: `code` and code blocks remain compatible
  • Uses proper Block Kit structure with "type": "section" and "type": "mrkdwn"

Related Issues or Context

This enhancement addresses the need for proper markdown formatting support in Slack bot responses, ensuring that formatted text from Dify applications displays correctly in Slack channels with proper visual emphasis.

This PR contains Changes to Non-Plugin

  • Documentation
  • Other

This PR contains Changes to Non-LLM Models Plugin

  • I have Run Comprehensive Tests Relevant to My Changes

This PR contains Changes to LLM Models Plugin

  • My Changes Affect Message Flow Handling (System Messages and User→Assistant Turn-Taking)
  • My Changes Affect Tool Interaction Flow (Multi-Round Usage and Output Handling, for both Agent App and Agent Node)
  • My Changes Affect Multimodal Input Handling (Images, PDFs, Audio, Video, etc.)
  • My Changes Affect Multimodal Output Generation (Images, Audio, Video, etc.)
  • My Changes Affect Structured Output Format (JSON, XML, etc.)
  • My Changes Affect Token Consumption Metrics
  • My Changes Affect Other LLM Functionalities (Reasoning Process, Grounding, Prompt Caching, etc.)
  • Other Changes (Add New Models, Fix Model Parameters etc.)

Version Control (Any Changes to the Plugin Will Require Bumping the Version)

  • I have Bumped Up the Version in Manifest.yaml (Top-Level Version Field, Not in Meta Section)

Dify Plugin SDK Version

  • I have Ensured dify_plugin>=0.3.0,<0.5.0 is in requirements.txt

Environment Verification (If Any Code Changes)

Local Deployment Environment

  • Dify Version is: 1.8.0, I have Tested My Changes on Local Deployment Dify with a Clean Environment That Matches the Production Configuration.

SaaS Environment

  • I have Tested My Changes on cloud.dify.ai with a Clean Environment That Matches the Production Configuration

Testing Notes

  • Verified markdown conversion function handles all supported formats correctly
  • Confirmed Block Kit structure displays formatted messages properly in Slack
  • Tested with various markdown combinations (bold + italic, links with code, etc.)
  • Ensured backward compatibility with plain text messages

🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.

## 📋 Pull Request Information **Original PR:** https://github.com/langgenius/dify-official-plugins/pull/1625 **Author:** [@Cluas](https://github.com/Cluas) **Created:** 9/1/2025 **Status:** ✅ Merged **Merged:** 9/1/2025 **Merged by:** [@crazywoola](https://github.com/crazywoola) **Base:** `main` ← **Head:** `feat-slack_bot_support_markdown` --- ### 📝 Commits (2) - [`018cb3f`](https://github.com/langgenius/dify-official-plugins/commit/018cb3f2670c5e22640d924ecf7667b3d0acfdbe) feat(slack_bot): support markdown formatting - [`f070818`](https://github.com/langgenius/dify-official-plugins/commit/f0708188222f28f01036c3bb0d688969ebaabc35) feat(slack_bot): integrate markdown_to_mrkdwn for message formatting ### 📊 Changes **4 files changed** (+23 additions, -9 deletions) <details> <summary>View changed files</summary> 📝 `extensions/slack_bot/README.md` (+1 -1) 📝 `extensions/slack_bot/endpoints/slack.py` (+18 -5) 📝 `extensions/slack_bot/manifest.yaml` (+3 -3) 📝 `extensions/slack_bot/requirements.txt` (+1 -0) </details> ### 📄 Description ## Summary Enhanced Slack Bot plugin to support proper markdown formatting in messages. The bot now correctly converts standard markdown to Slack's mrkdwn format and uses proper Block Kit structure for rich message display. This is especially important in the era of LLMs, as many large models use markdown responses. ### Changes Made - use https://github.com/fla9ua/markdown_to_mrkdwn to convert standard markdown syntax to Slack mrkdwn format - Updated message sending logic to use Block Kit with proper `mrkdwn` text type - Simplified code by removing complex original blocks manipulation - Added support for bold, italic, strikethrough, inline code, links, and code blocks formatting ### Technical Details - **Bold**: `**text**` → `*text*` - **Italic**: `*text*` → `_text_` - **Strikethrough**: `~~text~~` → `~text~` - **Links**: `[text](url)` → `<url|text>` - **Code**: `` `code` `` and ```code blocks``` remain compatible - Uses proper Block Kit structure with `"type": "section"` and `"type": "mrkdwn"` ## Related Issues or Context This enhancement addresses the need for proper markdown formatting support in Slack bot responses, ensuring that formatted text from Dify applications displays correctly in Slack channels with proper visual emphasis. ## This PR contains Changes to *Non-Plugin* - [ ] Documentation - [ ] Other ## This PR contains Changes to *Non-LLM Models Plugin* - [x] I have Run Comprehensive Tests Relevant to My Changes ## This PR contains Changes to *LLM Models Plugin* - [ ] My Changes Affect Message Flow Handling (System Messages and User→Assistant Turn-Taking) - [ ] My Changes Affect Tool Interaction Flow (Multi-Round Usage and Output Handling, for both Agent App and Agent Node) - [ ] My Changes Affect Multimodal Input Handling (Images, PDFs, Audio, Video, etc.) - [ ] My Changes Affect Multimodal Output Generation (Images, Audio, Video, etc.) - [ ] My Changes Affect Structured Output Format (JSON, XML, etc.) - [ ] My Changes Affect Token Consumption Metrics - [ ] My Changes Affect Other LLM Functionalities (Reasoning Process, Grounding, Prompt Caching, etc.) - [ ] Other Changes (Add New Models, Fix Model Parameters etc.) ## Version Control (Any Changes to the Plugin Will Require Bumping the Version) - [x] I have Bumped Up the Version in Manifest.yaml (Top-Level `Version` Field, Not in Meta Section) <!-- Updated from 0.0.3 to 0.0.4 --> ## Dify Plugin SDK Version - [x] I have Ensured `dify_plugin>=0.3.0,<0.5.0` is in requirements.txt <!-- Current version: dify_plugin==0.0.1b65 --> ## Environment Verification (If Any Code Changes) ### Local Deployment Environment - [x] Dify Version is: 1.8.0, I have Tested My Changes on Local Deployment Dify with a Clean Environment That Matches the Production Configuration. ### SaaS Environment - [ ] I have Tested My Changes on cloud.dify.ai with a Clean Environment That Matches the Production Configuration ### Testing Notes - Verified markdown conversion function handles all supported formats correctly - Confirmed Block Kit structure displays formatted messages properly in Slack - Tested with various markdown combinations (bold + italic, links with code, etc.) - Ensured backward compatibility with plain text messages --- <sub>🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.</sub>
yindo added the pull-request label 2026-02-16 11:15:48 -05:00
yindo closed this issue 2026-02-16 11:15:48 -05:00
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: langgenius/dify-official-plugins#1995