fix(feishu): render markdown tables as aligned code blocks instead of raw text - #32648
Closed
notwitcheer wants to merge 1 commit into
Closed
fix(feishu): render markdown tables as aligned code blocks instead of raw text#32648notwitcheer wants to merge 1 commit into
notwitcheer wants to merge 1 commit into
Conversation
… raw text Feishu's post-type 'md' elements cannot render GFM pipe tables. The adapter previously fell back to plain text mode for the entire message, losing all other markdown formatting. Convert tables to aligned monospaced code blocks in-place so tables are readable and the surrounding markdown is preserved as a post. Closes #32607 Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Collaborator
|
Part of the saturated Feishu markdown table rendering cluster tracked at #27469. Canonical issue: #9549, canonical PR: #12114. Competing with #21872 (aligned code fences), #20580 (closed, monospace code blocks — same approach), and #32488 (Schema 2.0 cards). This PR takes the code-block approach which overlaps with #20580 and #21872. |
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.
What does this PR do?
Closes #32607.
Feishu's post-type
mdelements cannot render GFM pipe tables. The adapter previously fell back to plain text mode for the entire message when any markdown table was detected, losing all other markdown formatting (bold, italic, code blocks, lists, links).This PR converts markdown tables to aligned monospaced code blocks in-place, so:
post, nottext)Before (raw text fallback)
After (aligned code block)
Related Issue
Closes #32607.
Type of Change
Changes Made
gateway/platforms/feishu.py:_split_table_row(),_render_table_as_code_block(), and_convert_tables_to_code_blocks()helpers (same pattern as Telegram's_wrap_markdown_tables)_build_outbound_payload()now converts tables to code blocks instead of falling back to"text"typetests/gateway/test_feishu.py— 4 new tests (TestFeishuTableConversion): simple table conversion, non-table passthrough, code-block-guarded tables, and outbound payload type check.How to Test
Checklist
Code
fix(feishu):)_wrap_markdown_tables)