Feishu table and code block rendering fixes
Cluster 19035 · gateway. Data as of
2 open items. Fix merged in #20275 on 5 May 2026. Check it covers your case.
The short answer
- Known?
- Yes. 6 related items grouped here, 0 issues already closed.
- Fix event
- A fix was merged to main in PR #20275. Check it covers your case. No release data is tracked.
- Tracker
- The maintainers' tracker marks this
unresolved. That is separate from the fix event. - Still open
- 1 issue and 1 PR.
Next step: read #20275, then check whether your report is the one still open.
Read #20275Pick up a Lab taskMultiple attempts and approaches to fix how markdown tables and fenced code blocks are rendered in Feishu, including routing them through CardKit 2.0, native card components, and fallback modes. A related issue reports code blocks being truncated to only the first couple of lines.
Open issues1
- Issue#19035[Feishu] Code blocks cannot be expanded — only first ~2 lines visible
Open PRs1
- PR#40445feat(feishu): render markdown tables as native Card JSON 2.0 table components
Fixes on record
-
#20275 fix(feishu): force text mode for markdown tables (salvage #13723)
files:
gateway/platforms/feishu.pyShow the diff
-
gateway/platforms/feishu.py@@ -153,6 +153,9 @@ r"(^#{1,6}\s)|(^\s*[-*]\s)|(^\s*\d+\.\s)|(^\s*---+\s*$)|(```)|(`[^`\n]+`)|(\*\*[^*\n].+?\*\*)|(~~[^~\n].+?~~)|(<u>.+?</u>)|(\*[^*\n]+\*)|(\[[^\]]+\]\([^)]+\))|(^>\s)", re.MULTILINE, ) +# Detect markdown tables: a line starting with | followed by a separator line. +# Feishu post-type 'md' elements do not render tables, so we force text mode. +_MARKDOWN_TABLE_RE = re.compile(r"^\|.*\|\n\|[-|: ]+\|", re.MULTILINE) _MARKDOWN_LINK_RE = re.compile(r"\[([^\]]+)\]\(([^)]+)\)") _MARKDOWN_FENCE_OPEN_RE = re.compile(r"^```([^\n`]*)\s*$") _MARKDOWN_FENCE_CLOSE_RE = re.compile(r"^```\s*$") @@ -3995,6 +3998,12 @@ def _is_duplicate(self, message_id: str) -> bool: # ========================================================================= def _build_outbound_payload(self, content: str) -> tuple[str, str]: + # Feishu post-type 'md' elements do not render markdown tables; sending + # table content as post causes the message to appear blank on the client. + # Force plain text for anything that looks like a markdown table. + if _MARKDOWN_TABLE_RE.search(content): + text_payload = {"text": content} + return "text", json.dumps(text_payload, ensure_ascii=False) if _MARKDOWN_HINT_RE.search(content): return "post", _build_markdown_post_payload(content) text_payload = {"text": content}
-
3 PRs closed without merging
From the close comments: done elsewhere 2 · superseded by another PR 1
-
#19038 fix(feishu): route tables and multi-line code blocks to CardKit 2.0 · done elsewhere →
#20275,#13723,#19035,#9549 - #23861 fix(feishu): route tables and code blocks to CardKit 2.0 with post/text fallback · done elsewhere
-
#33310 fix(feishu): render markdown tables and code blocks via CardKit 2.0 cards · superseded by another PR →
#53453,#53355,#36877
How this cluster was grouped
-
Link evidence (
structural links throughout): every member is connected by structural evidence: shared changed files, or a closing/superseded reference. -
Pairwise link density
0.33: the share of item pairs that carry a link, counting a structural link in full and a relevance-only link at 0.36.1.00means every pair is linked.
Pick up a Lab task
Check whether a fix covers the open issues here, with your own agent. Bring back evidence for maintainers.
Open the LabAt a glance
- Subsystem
- gateway
- Merged PRs
- #20275
- Closed issues
- 0
- Attempts
- 3 PRs closed without merging
- Fix link checked
- 5 May 2026