feat(feishu): render markdown tables as native card tables - #53071
Open
kreshan1997-alt wants to merge 1 commit into
Open
feat(feishu): render markdown tables as native card tables#53071kreshan1997-alt wants to merge 1 commit into
kreshan1997-alt wants to merge 1 commit into
Conversation
Feishu post-type messages do not render markdown tables, causing table content to appear blank or as raw pipe-separated text. This change detects markdown tables in outbound messages and sends them as interactive cards with a native table element (schema 2.0). Changes: - Add _parse_md_table_content() to extract table structure and surrounding text from markdown content - Add _build_table_card_payload() to construct a Feishu card JSON with table element, including before/after markdown context - Modify _build_outbound_payload() to route tables as 'interactive' msg_type instead of forcing plain text - Add fallback logic in send() to degrade interactive cards to plain text on API rejection (matching existing post-type fallback)
Collaborator
Contributor
|
Thanks for addressing a real Feishu rendering limitation: current main deliberately falls back to plain text for detected markdown tables at Problems
Suggested changes
Automated hermes-sweeper review. |
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.
Problem
Feishu post-type messages do not render markdown tables. When the agent responds with table content, it appears blank or as raw pipe-separated text. Current workaround forces plain text for any content containing a table, losing all formatting.
Solution
Detect markdown tables in outbound messages and send them as interactive cards with a native table element (Feishu card schema 2.0), while preserving surrounding markdown text.
Changes
_parse_md_table_content()— Parse markdown table structure and split surrounding text_build_table_card_payload()— Build Feishu 2.0 card with table element_build_outbound_payload()— Route tables asinteractivemsg_typesend()— Degrade interactive cards to plain text on API rejectionTesting
Verified on live Feishu bot with various table sizes and mixed content. Fallback confirmed on API rejection.