feat(feishu): render markdown tables as CardKit v2 native table components - #48807
Open
vvv-cyber wants to merge 1 commit into
Open
feat(feishu): render markdown tables as CardKit v2 native table components#48807vvv-cyber wants to merge 1 commit into
vvv-cyber wants to merge 1 commit into
Conversation
Collaborator
tonydwb
approved these changes
Jun 19, 2026
tonydwb
left a comment
There was a problem hiding this comment.
Code Review Summary
Verdict: Approved
- 2 files changed, +283/-9 lines — renders markdown tables as CardKit v2 native table components in Feishu
- Adds markdown table parser with proper cell alignment; clean feature enhancement
Reviewed by Hermes Agent
This was referenced Jun 24, 2026
Contributor
|
Thanks for addressing a real Feishu rendering gap. Current main still routes detected tables to plain text at Problems
Suggested changes
Automated hermes-sweeper review. |
vvv-cyber
force-pushed
the
feat/feishu-table-cardkit-v2
branch
from
July 15, 2026 14:31
2d2729c to
ab550ae
Compare
Author
|
Ported the implementation to the bundled Feishu plugin architecture on current
Verification: |
Collaborator
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/Lark's post-type
mdtag does not support markdown table syntax (| col | col |). The current adapter detects markdown tables and forces them to plain text (_MARKDOWN_TABLE_RE→textmsg_type), losing all table structure. Users see raw pipe-delimited text instead of a formatted table.Closes #9549
Solution
Detect markdown tables in outbound content and convert them to CardKit v2 interactive cards with native
tablecomponents, while non-table text renders asmarkdownelements within the same card.Changes
gateway/platforms/feishu.py(+177/-9):_MARKDOWN_TABLE_LINE_RE/_MARKDOWN_TABLE_DIVIDER_RE— table row and separator detection_parse_markdown_table(text)— splits content into[{"type": "text"/"table", ...}]segments_build_table_card(headers, rows)— builds CardKit v2tablecomponent (columns + rows dict-list, strips**bold markers, setsheader_style)_build_interactive_card_with_tables(text)— assemblesschema: "2.0"card: table segments →tableelements, text segments →markdownelements_build_outbound_payload()— routes table content tointeractivemsg_type; non-table content unchangedtests/gateway/test_feishu.py(+106): 11 unit tests covering table parsing, card structure, bold stripping, row normalization, and mixed text/table content.Behavior
Example CardKit v2 output
```json
{
"schema": "2.0",
"config": {"wide_screen_mode": true},
"body": {
"elements": [
{"tag": "markdown", "content": "Some intro text"},
{
"tag": "table",
"columns": [
{"name": "col_0", "display_name": "Name", "data_type": "text", "width": "auto"},
{"name": "col_1", "display_name": "Age", "data_type": "text", "width": "auto"}
],
"rows": [
{"col_0": "Alice", "col_1": "30"},
{"col_0": "Bob", "col_1": "25"}
],
"header_style": {"bold": true, "text_align": "left", "text_size": "normal"}
}
]
}
}
```
Notes
**,__) in headers/cells are stripped (CardKit v2textdata_type doesn't support markdown syntax;header_style.bold: truehandles header emphasisTesting
References
EOF
)