Skip to content

fix(feishu): wrap markdown tables in code_block tags for post rendering - #22259

Closed
asdlem wants to merge 1 commit into
NousResearch:mainfrom
asdlem:fix/feishu-table-codeblock-post
Closed

fix(feishu): wrap markdown tables in code_block tags for post rendering#22259
asdlem wants to merge 1 commit into
NousResearch:mainfrom
asdlem:fix/feishu-table-codeblock-post

Conversation

@asdlem

@asdlem asdlem commented May 9, 2026

Copy link
Copy Markdown
Contributor

Problem

Feishu's post md tag drops markdown tables silently, while the old workaround (forcing text mode) loses bold, italic, code, links, and lists.

Solution

  1. _convert_tables_to_code_blocks — wraps markdown tables in ``` fences
  2. _build_markdown_post_rows — detects ``` fences and emits Feishu's native code_block tags (instead of `md`)
  3. _choose_outbound_msg_type — module-level routing: tables→code-fence+post, MD→post, else→text
  4. _build_outbound_payload — simplified to delegate

Result

  • Tables render as code blocks (monospaced, visible)
  • All other markdown (bold, italic, links, lists, headings) renders correctly
  • No regression: 198/198 tests pass

Related

Fixes #21778

Feishu's post md tag drops markdown tables silently.  Instead of
forcing plain-text mode (which loses bold/links/lists), we:
1. Wrap tables in ``` fences via _convert_tables_to_code_blocks
2. Emit code_block tags in _build_markdown_post_rows for fenced content
3. Route to post mode so surrounding prose keeps its formatting

Fixes NousResearch#21778
@alt-glitch alt-glitch added type/bug Something isn't working comp/gateway Gateway runner, session dispatch, delivery platform/feishu Feishu / Lark adapter P2 Medium — degraded but workaround exists labels May 9, 2026
@asdlem

asdlem commented May 9, 2026

Copy link
Copy Markdown
Contributor Author

Supersedes #22047. Both PRs fix the same regression (tables forcing plain-text mode), but this one goes further:

Same bug fix + better UX for table content.

@asdlem

asdlem commented Jun 9, 2026

Copy link
Copy Markdown
Contributor Author

Hi @teknium1 — gentle ping for review. This PR fixes #21778. Rebased cleanly onto main, 205 tests passing. Wraps tables in code blocks for Feishu rendering. Same pattern as #27852#28475. Thanks!

@asdlem

asdlem commented Jun 29, 2026

Copy link
Copy Markdown
Contributor Author

main now has _MARKDOWN_TABLE_RE fallback to plain text — the white-screen bug is resolved. The code_block approach here is more elegant but functionally redundant.

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.

Bug Report: Feishu (Lark) Markdown Table Rendering Regression in v0.13.0

2 participants