mirror of
https://github.com/moltbot/moltbot.git
synced 2026-05-13 23:56:07 +00:00
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:
@@ -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:
|
||||
|
||||
@@ -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");
|
||||
});
|
||||
});
|
||||
|
||||
@@ -450,6 +450,7 @@ export const matrixPlugin: ChannelPlugin<ResolvedMatrixAccount, MatrixProbe> =
|
||||
}).map(projectMatrixConversationBinding),
|
||||
},
|
||||
messaging: {
|
||||
defaultMarkdownTableMode: "bullets",
|
||||
targetPrefixes: ["matrix"],
|
||||
normalizeTarget: normalizeMatrixMessagingTarget,
|
||||
resolveInboundConversation: ({ to, conversationId, threadId }) =>
|
||||
|
||||
Reference in New Issue
Block a user