fix(matrix): default markdown tables to bullets across Matrix clients

Matrix outbound markdown was hitting the shared `resolveMarkdownTableMode`
"code" fallback for every send because the Matrix channel plugin never
declared `defaultMarkdownTableMode` in its `messaging` block at
`extensions/matrix/src/channel.ts:452`. Tables were emitted as
`<pre><code>` fenced blocks across every Matrix client.

This change declares `defaultMarkdownTableMode: "bullets"`, matching the
Signal and WhatsApp precedent at `extensions/signal/src/shared.ts:111`
and `extensions/whatsapp/src/shared.ts:261`. The choice matches the
cross-client compatibility profile the issue filer surveyed:
Element X iOS squashes HTML `<table>` and Element X Android drops cell
text entirely (element-hq/element-x-android#1551), while bullet lists
render cleanly across every Matrix client. Operators wanting the
previous fenced-code rendering can set `channels.matrix.markdown.tables:
"code"` explicitly; clients that do render real tables can opt in with
`channels.matrix.markdown.tables: "off"` (markdown-it's `table` rule is
already enabled by default through the markdown-it default preset, so
raw markdown tables flow through to native HTML tables on that path).

Docs and the changelog entry list Matrix alongside Signal and WhatsApp
as a bullet-default channel.

Fixes #78990.
This commit is contained in:
kinjitakabe
2026-05-12 14:15:46 +09:00
committed by Ayaan Zaidi
parent 9d4081b839
commit 09a2d6e571
3 changed files with 6 additions and 1 deletions

View File

@@ -65,7 +65,7 @@ Markdown tables are not consistently supported across chat clients. Use
`markdown.tables` to control conversion per channel (and per account).
- `code`: render tables as code blocks (default for most channels).
- `bullets`: convert each row into bullet points (default for Signal + WhatsApp).
- `bullets`: convert each row into bullet points (default for Matrix, Signal, and WhatsApp).
- `off`: disable table parsing and conversion; raw table text passes through.
Config keys:

View File

@@ -238,4 +238,8 @@ describe("matrix channel message adapter", () => {
},
});
});
it("declares bullets as defaultMarkdownTableMode to avoid code-block fallthrough (#78990)", () => {
expect(matrixPlugin.messaging?.defaultMarkdownTableMode).toBe("bullets");
});
});

View File

@@ -450,6 +450,7 @@ export const matrixPlugin: ChannelPlugin<ResolvedMatrixAccount, MatrixProbe> =
}).map(projectMatrixConversationBinding),
},
messaging: {
defaultMarkdownTableMode: "bullets",
targetPrefixes: ["matrix"],
normalizeTarget: normalizeMatrixMessagingTarget,
resolveInboundConversation: ({ to, conversationId, threadId }) =>