feat(feishu): support markdown tables via CardKit table element (JSON 2.0 schema)#31038
Open
wangzxjh wants to merge 1 commit into
Open
feat(feishu): support markdown tables via CardKit table element (JSON 2.0 schema)#31038wangzxjh wants to merge 1 commit into
wangzxjh wants to merge 1 commit into
Conversation
… 2.0 schema) Feishu post-type messages do not render markdown tables — they display as raw | characters. This adds detection of code blocks and markdown tables in _build_outbound_payload(), routing them to interactive cards (JSON 2.0 schema) instead of text or post. Changes: - _build_card_payload_from_blocks(): builds a JSON 2.0 card with mixed markdown + table elements - _build_card_table_element(): parses markdown tables into native CardKit table components with proper columns and rows - _split_into_card_elements(): interleaves text and table blocks preserving original order - _get_tenant_access_token() + _send_interactive_via_rest(): sends interactive cards via direct REST API (lark-oapi SDK does not handle JSON 2.0 card schema correctly for msg_type=interactive) - _feishu_send_with_retry(): routes msg_type=interactive to REST path - _build_outbound_payload(): detects code blocks and markdown tables and returns interactive cards instead of text/post Closes NousResearch#27695
Collaborator
This was referenced May 25, 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.
Problem
Feishu
posttype messages do not render markdown tables — they display as raw|characters, making table-formatted data unreadable.Solution
Detect code blocks (
`) and markdown tables via regex and route them to a JSON 2.0 interactive card with native CardKittableelements instead ofpostor plaintext.Key changes
_build_card_payload_from_blocks()— splits content into markdown and table elements, builds a JSON 2.0 card_build_card_table_element()— parses markdown tables into CardKittablecomponents_split_into_card_elements()— interleaves text and table blocks preserving original order_send_interactive_via_rest()— sends interactive cards via direct REST API (lark-oapi SDK does not handle JSON 2.0 schema correctly formsg_type=interactive)_feishu_send_with_retry()— routesmsg_type=interactiveto REST path_build_outbound_payload()— detects code blocks and markdown tables, returns interactive cardsBackwards Compatibility
_build_card_code_payload()kept as backward-compat aliasCloses #27695