feat(feishu): render Markdown tables as native card table component#38453
Open
TonyHe-Lab wants to merge 2 commits into
Open
feat(feishu): render Markdown tables as native card table component#38453TonyHe-Lab wants to merge 2 commits into
TonyHe-Lab wants to merge 2 commits into
Conversation
added 2 commits
June 4, 2026 04:27
…onent - Parse Markdown pipe tables into Feishu JSON 2.0 'table' component via new _parse_markdown_table() and _split_content_and_tables() methods - Rewrite _build_outbound_payload() to always return 'interactive' card with schema 2.0, mixing markdown elements and table components - Expand _POST_CONTENT_INVALID_RE to match additional Feishu card error messages (failed to create card content, card contains images) - Update fallback logic in send_message, edit_message, and _feishu_send_with_retry to handle 'interactive' msg_type alongside 'post' - Update 7 tests to assert 'interactive' card structure instead of 'post' - All 205 feishu adapter tests pass
Previously table cells used data_type='text' with manual markdown stripping. Feishu table component supports data_type='markdown' (v7.14+) which renders bold, italic, links, images etc natively.
2c842f6 to
d2cd44f
Compare
This was referenced Jun 11, 2026
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
Markdown tables in Feishu messages currently display as raw pipe-separated text because Feishu's
postmessage type does not support table rendering.This PR switches outbound messages to use Feishu interactive cards (JSON schema 2.0) with the native
tablecomponent, while keeping non-table content asmarkdownelements within the same card.Changes
gateway/platforms/feishu.py_parse_markdown_table(): parses| col | col |lines into Feishu table component JSON (columns,rows,header_style)_split_content_and_tables(): line-by-line scanner that groups consecutive table lines and converts them, collecting non-table lines into markdown elements_build_outbound_payload(): always returnsinteractivemsg_type with schema 2.0 card structure, mixing markdown + table elements_POST_CONTENT_INVALID_REregex to match additional Feishu card error messagessend_message,edit_message,_feishu_send_with_retryto handleinteractivealongsideposttests/gateway/test_feishu.pyinteractivecard structure withschema: "2.0"andbody.elementsinstead ofposttypeTest Results
All 205 Feishu adapter tests pass.
Before / After
Before: Table messages show as raw
| | |plain textAfter: Tables render natively as Feishu card table component with headers and cell borders