fix: add per-channel markdown table conversion (#1495) (thanks @odysseus0)
This commit is contained in:
@@ -4,6 +4,9 @@ import { getChildLogger } from "../logging/logger.js";
|
||||
import { createSubsystemLogger } from "../logging/subsystem.js";
|
||||
import { normalizePollInput, type PollInput } from "../polls.js";
|
||||
import { toWhatsappJid } from "../utils.js";
|
||||
import { loadConfig } from "../config/config.js";
|
||||
import { resolveMarkdownTableMode } from "../config/markdown-tables.js";
|
||||
import { convertMarkdownTables } from "../markdown/tables.js";
|
||||
import { type ActiveWebSendOptions, requireActiveWebListener } from "./active-listener.js";
|
||||
import { loadWebMedia } from "./media.js";
|
||||
|
||||
@@ -25,6 +28,13 @@ export async function sendMessageWhatsApp(
|
||||
const { listener: active, accountId: resolvedAccountId } = requireActiveWebListener(
|
||||
options.accountId,
|
||||
);
|
||||
const cfg = loadConfig();
|
||||
const tableMode = resolveMarkdownTableMode({
|
||||
cfg,
|
||||
channel: "whatsapp",
|
||||
accountId: resolvedAccountId ?? options.accountId,
|
||||
});
|
||||
text = convertMarkdownTables(text ?? "", tableMode);
|
||||
const logger = getChildLogger({
|
||||
module: "web-outbound",
|
||||
correlationId,
|
||||
|
||||
Reference in New Issue
Block a user