feat(feishu): render markdown tables as JSON 2.0 cards - #26429
Open
hikari0511 wants to merge 1 commit into
Open
Conversation
Feishu's post-type 'md' elements do not support markdown tables,
causing table content to render as ugly plain text with pipe characters.
This change detects markdown table content and sends it as an
interactive card with schema 2.0, which natively renders tables
with proper borders, alignment, and pagination (max 5 data rows).
The card format is:
{
schema: '2.0',
body: { elements: [{ tag: 'markdown', content: ... }] }
}
Contributor
This was referenced Jun 13, 2026
Closed
Closed
This was referenced Jun 23, 2026
teknium1
reviewed
Jul 13, 2026
teknium1
left a comment
Contributor
There was a problem hiding this comment.
Thanks for the focused Feishu table-rendering fix. The underlying behavior is still present, but this patch no longer reaches the active adapter.
Problems
gateway/platforms/feishu.pywas relocated by552adbe0827c32df8ed9bb19e908c26eff43add7; current table handling remains inplugins/platforms/feishu/adapter.py:4524-4534, where it returns"text"for_MARKDOWN_TABLE_RE.- The PR diff changes only the old source file and adds no regression test.
_build_outbound_payloadfeeds both normal sends (plugins/platforms/feishu/adapter.py:1904) and edits (:1958).
Suggested changes
- Port this branch to
plugins/platforms/feishu/adapter.py:_build_outbound_payloadand add a plugin-path payload test asserting the interactive Card JSON 2.0 output for a detected table while retaining non-table paths. - The adapter already sends interactive cards through its normal send transport for approvals (
plugins/platforms/feishu/adapter.py:2029-2033), so that is the established integration path to cover.
Automated hermes-sweeper review.
| return "text", json.dumps(text_payload, ensure_ascii=False) | ||
| # JSON 2.0 card renders markdown tables natively with borders and alignment. | ||
| card = { | ||
| "schema": "2.0", |
Contributor
There was a problem hiding this comment.
Current main relocated the active Feishu adapter to plugins/platforms/feishu/adapter.py in 552adbe0827c32df8ed9bb19e908c26eff43add7; its live table branch is now at :4524-4530. Port this change there and add a payload-selection regression test, since this old path no longer affects runtime behavior.
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 messages with markdown tables render as ugly plain text with pipe characters (
|) because the adapter sends them asmsg_type: "text"which does not support table syntax.Solution
When the content contains a markdown table, send it as an interactive card with
schema: "2.0"instead. Feishu JSON 2.0 cards natively render markdown tables with:Change
In
gateway/platforms/feishu.py,_build_outbound_payload():Before: table content →
msg_type: "text"(ugly plain text)After: table content →
msg_type: "interactive"with card JSON 2.0 (native table rendering)Testing
post/textpaths (no behavior change)_MARKDOWN_TABLE_REregex detection is unchanged — only the rendering path is affectedReferences