fix(feishu): convert markdown tables to lists before rendering - #20635
Closed
thunderredondo wants to merge 1 commit into
Closed
fix(feishu): convert markdown tables to lists before rendering#20635thunderredondo wants to merge 1 commit into
thunderredondo wants to merge 1 commit into
Conversation
Feishu's md renderer does not support markdown table syntax (| col | col |). Tables are silently rendered as blank cells, sometimes swallowing trailing content. This is a known limitation of the Feishu post message format, not a rendering bug — the md tag spec simply omits table support. Add _convert_tables_to_text() which detects markdown table blocks (header + separator + data rows) and converts them to readable bullet lists using header values as labels. Pipes inside fenced code blocks are left untouched. The conversion runs at the top of _build_markdown_post_rows(), so all outbound Feishu markdown messages benefit automatically. Includes 9 unit tests covering: simple/3-column tables, surrounding prose, no-table passthrough, code block isolation, empty cells, and integration with the post row builder.
Collaborator
Author
|
Closing as duplicate of #15956 (same approach, 10 days earlier). Hoping #15956 or #20028 gets merged soon — the Feishu table rendering issue is a real pain point. Thanks @alt-glitch for pointing it out. |
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's
mdrenderer (used in post messages) does not support markdown table syntax. When a message contains| col | col |tables, they render as blank cells. In some cases the blank table also swallows trailing content.This is a known limitation of Feishu's post message format — the
mdtag spec omits table support entirely. It's not a transient rendering glitch.Reproduction
Send any markdown table via the Feishu post API:
{"tag": "md", "text": "| A | B |\n|---|---|\n| 1 | 2 |"}Result: blank space where the table should be.
Fix
Add
_convert_tables_to_text()togateway/platforms/feishu.pywhich:The conversion runs at the top of
_build_markdown_post_rows(), so all outbound Feishu markdown messages benefit automatically.Before (blank)
After (readable)
Tests
9 unit tests covering:
_build_markdown_post_rowsAll 194 existing Feishu tests pass with zero regressions.