Skip to content

fix(feishu): convert markdown tables to lists before rendering - #20635

Closed
thunderredondo wants to merge 1 commit into
NousResearch:mainfrom
thunderredondo:fix/feishu-table-rendering
Closed

fix(feishu): convert markdown tables to lists before rendering#20635
thunderredondo wants to merge 1 commit into
NousResearch:mainfrom
thunderredondo:fix/feishu-table-rendering

Conversation

@thunderredondo

Copy link
Copy Markdown

Problem

Feishu's md renderer (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 md tag 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() to gateway/platforms/feishu.py which:

  1. Detects markdown table blocks (header row + separator row + data rows)
  2. Converts each data row to a bullet list item using header values as labels
  3. Leaves pipes inside fenced code blocks untouched

The conversion runs at the top of _build_markdown_post_rows(), so all outbound Feishu markdown messages benefit automatically.

Before (blank)

| 项目 | 值 | 说明 |
|------|-----|------|
| 模型 | mimo-v2.5-pro | 主模型 |

After (readable)

- 项目:模型 | 值:mimo-v2.5-pro | 说明:主模型

Tests

9 unit tests covering:

  • Simple 2-column and 3-column tables
  • Table with surrounding prose
  • No-table content passthrough
  • Pipe inside code block not treated as table
  • Empty cells
  • Single row table
  • Integration with _build_markdown_post_rows

All 194 existing Feishu tests pass with zero regressions.

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.
@alt-glitch alt-glitch added type/bug Something isn't working P2 Medium — degraded but workaround exists platform/feishu Feishu / Lark adapter comp/gateway Gateway runner, session dispatch, delivery labels May 6, 2026
@alt-glitch

Copy link
Copy Markdown
Collaborator

Duplicate of #15956 — same fix approach (convert markdown tables to text/lists for Feishu post messages). Also competes with #20028 and addresses #9549.

@thunderredondo

Copy link
Copy Markdown
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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

comp/gateway Gateway runner, session dispatch, delivery P2 Medium — degraded but workaround exists platform/feishu Feishu / Lark adapter type/bug Something isn't working

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants