diff --git a/plugins/platforms/feishu/adapter.py b/plugins/platforms/feishu/adapter.py index ba18f22292c2..7fc484ba1de0 100644 --- a/plugins/platforms/feishu/adapter.py +++ b/plugins/platforms/feishu/adapter.py @@ -4468,13 +4468,13 @@ 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): + # Send markdown content (including tables) as 'post' message type. + # Feishu's post md tag renders standard markdown; tables are also + # rendered correctly when sent via post. The previous workaround that + # forced table content to plain text (msg_type="text") produced raw + # pipe-delimited output which was strictly worse. + # Refs: #21866, #27469 + if _MARKDOWN_HINT_RE.search(content) or _MARKDOWN_TABLE_RE.search(content): return "post", _build_markdown_post_payload(content) text_payload = {"text": content} return "text", json.dumps(text_payload, ensure_ascii=False)