fix(feishu): render markdown tables via post+md instead of force-text - #27739
Closed
hupp1203-cmd wants to merge 1 commit into
Closed
hupp1203-cmd wants to merge 1 commit into
hupp1203-cmd wants to merge 1 commit into
Conversation
Feishu post-type messages with tag:md support full GFM markdown including tables. The _MARKDOWN_TABLE_RE force-text fallback in _build_outbound_payload was downgrading any message containing a table to plain text, stripping ALL markdown formatting. Fix: - Add _TABLE_BLOCK_RE to detect markdown table blocks - Route table content through post (tag:md) instead of text - Update docstring to reflect md tag GFM support Related: #27529, #26658
This was referenced May 18, 2026
Open
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.
Feishu post-type messages with tag:md support full GFM markdown including tables. The _MARKDOWN_TABLE_RE force-text fallback in _build_outbound_payload was downgrading any message containing a table to plain text, stripping ALL markdown formatting.
Fix:
Related: [feishu] Fix markdown table rendering: use post+tag:md instead of force-text workaround #27529, [feishu] Remove markdown table force-text workaround — Feishu now supports tables in post format #26658
What does this PR do?
Fixes Feishu/Lark message rendering for content containing markdown tables.
In v0.14.0,
_build_outbound_payloaduses_MARKDOWN_TABLE_REto detect tables and forces the entire message to plaintexttype. While this prevented blank rendering (the original concern), it strips ALL markdown formatting — bold, italic, code blocks, links — making complex AI responses unreadable.This PR routes table-containing content through
postwithtag:mdelements, which natively support GFM tables. Tested on Feishu 7.x client.Related Issue
Fixes #27529
Type of Change
Changes Made
gateway/platforms/feishu.py: Add_TABLE_BLOCK_REregex for table detectiongateway/platforms/feishu.py: Modify_build_outbound_payloadto route table content throughpostinstead oftextgateway/platforms/feishu.py: Update_build_markdown_post_rowsdocstringHow to Test
Checklist
Code
pytest tests/ -qand all tests passDocumentation & Housekeeping