惯性聚合 高效追踪和阅读你感兴趣的博客、新闻、科技资讯
阅读原文 在惯性聚合中打开

推荐订阅源

宝玉的分享
宝玉的分享
Engineering at Meta
Engineering at Meta
让小产品的独立变现更简单 - ezindie.com
让小产品的独立变现更简单 - ezindie.com
博客园 - 聂微东
钛媒体:引领未来商业与生活新知
钛媒体:引领未来商业与生活新知
Last Week in AI
Last Week in AI
酷 壳 – CoolShell
酷 壳 – CoolShell
博客园 - 三生石上(FineUI控件)
T
Tailwind CSS Blog
Apple Machine Learning Research
Apple Machine Learning Research
Hugging Face - Blog
Hugging Face - Blog
爱范儿
爱范儿
博客园 - 司徒正美
人人都是产品经理
人人都是产品经理
Jina AI
Jina AI
博客园 - 叶小钗
雷峰网
雷峰网
罗磊的独立博客
OSCHINA 社区最新新闻
OSCHINA 社区最新新闻
博客园 - Franky
WordPress大学
WordPress大学
奇客Solidot–传递最新科技情报
奇客Solidot–传递最新科技情报
阮一峰的网络日志
阮一峰的网络日志
量子位

Recent Commits to openclaw:main

test: merge chat side-result checks · openclaw/openclaw@ddd2c2a test: merge cron history checks · openclaw/openclaw@f7eb746 test: merge responsive navigation shell checks · openclaw/openclaw@c2e4b47 docs(changelog): add codex oauth fixes · openclaw/openclaw@628e6cd test: merge navigation routing cases · openclaw/openclaw@5d8cecb Tests: mock channel registry bundled fallback · openclaw/openclaw@2b08233 Secrets: avoid broad web search discovery for single plugin config · openclaw/openclaw@a464f59 test: merge config view browser checks · openclaw/openclaw@20cf511 fix(status): align oauth health with runtime · openclaw/openclaw@eed7116 feat: add macOS screen snapshots for monitor preview (#67954) thanks … · openclaw/openclaw@f377db1 fix: report shared auth scopes in hello-ok (#67810) thanks @BunsDev · openclaw/openclaw@0b6c39b Auto-reply: avoid eager bundled route fallback · openclaw/openclaw@3ea1bf4 Tests: narrow session binding contract setup · openclaw/openclaw@54e4e16 fix(macOS): enable undo/redo in webchat composer text input (#34962) · openclaw/openclaw@00951dc Tests: speed up channel setup promotion · openclaw/openclaw@82b529a Docs: refresh agent instructions · openclaw/openclaw@5775fe2 fix(auth): serialize OAuth refresh across agents to fix #26322 (#67876) · openclaw/openclaw@8e79080 test: allow ollama public surface boundary test · openclaw/openclaw@7d4f1a6 Docs: add test performance guardrails · openclaw/openclaw@89706d3 Tests: restore context-engine usage proof · openclaw/openclaw@e4c4f95 Tests: slim context engine runtime coverage · openclaw/openclaw@74c198f ci: retry failed custom checkouts · openclaw/openclaw@0ee5baf test: trim duplicate provider auth onboarding cases · openclaw/openclaw@1ffc02e matrix: fix sessions_spawn --thread subagent session spawning (#67643) · openclaw/openclaw@1ce2596 test: reduce auth choice fixture churn · openclaw/openclaw@857b9cd test: mock health status config boundaries · openclaw/openclaw@9d5ab4a test: mock onboard config io boundary · openclaw/openclaw@299694d test: mock legacy state plugin boundaries · openclaw/openclaw@2713089 test: mock channel install boundaries · openclaw/openclaw@b945248 test: mock doctor preview channel boundaries · openclaw/openclaw@b1a3ad4
fix(telegram): preserve rich markdown line breaks · openc...
obviyus · 2026-06-15 · via Recent Commits to openclaw:main

@@ -947,8 +947,42 @@ describe("sendMessageTelegram", () => {

947947

});

948948

});

949949950-

it("keeps markdown media syntax on the text-only rich path", async () => {

950+

it("preserves rich markdown line breaks outside fenced code", async () => {

951951

botApi.sendMessage.mockResolvedValue({ message_id: 47, chat: { id: "123" } });

952+

const markdown = [

953+

"Status: ok | mode",

954+

"Models: ready",

955+

"",

956+

"```",

957+

"a",

958+

"b",

959+

"```",

960+

"Tail",

961+

].join("\n");

962+

const expectedMarkdown = [

963+

"Status: ok | mode ",

964+

"Models: ready",

965+

"",

966+

"```",

967+

"a",

968+

"b",

969+

"```",

970+

"Tail",

971+

].join("\n");

972+973+

await sendMessageTelegram("123", markdown, {

974+

cfg: TELEGRAM_TEST_CFG,

975+

token: "tok",

976+

});

977+978+

expect(botRawApi.sendRichMessage).toHaveBeenCalledWith({

979+

chat_id: "123",

980+

rich_message: { markdown: expectedMarkdown },

981+

});

982+

});

983+984+

it("keeps markdown media syntax on the text-only rich path", async () => {

985+

botApi.sendMessage.mockResolvedValue({ message_id: 48, chat: { id: "123" } });

952986953987

await sendMessageTelegram("123", "See ![diagram](https://example.com/diagram.png)", {

954988

cfg: TELEGRAM_TEST_CFG,

@@ -962,7 +996,7 @@ describe("sendMessageTelegram", () => {

962996

});

963997964998

it("escapes HTML media tags on the text-only rich path", async () => {

965-

botApi.sendMessage.mockResolvedValue({ message_id: 48, chat: { id: "123" } });

999+

botApi.sendMessage.mockResolvedValue({ message_id: 49, chat: { id: "123" } });

96610009671001

await sendMessageTelegram("123", '<b>See</b><img src="https://example.com/diagram.png">', {

9681002

cfg: TELEGRAM_TEST_CFG,

@@ -979,7 +1013,7 @@ describe("sendMessageTelegram", () => {

9791013

});

98010149811015

it("keeps native rich markdown tables within Telegram's column limit", async () => {

982-

botApi.sendMessage.mockResolvedValue({ message_id: 49, chat: { id: "123" } });

1016+

botApi.sendMessage.mockResolvedValue({ message_id: 50, chat: { id: "123" } });

9831017

const markdown = markdownTable(20);

98410189851019

await sendMessageTelegram("123", markdown, {

@@ -994,7 +1028,7 @@ describe("sendMessageTelegram", () => {

9941028

});

99510299961030

it("wraps wide rich markdown tables that exceed Telegram's column limit", async () => {

997-

botApi.sendMessage.mockResolvedValue({ message_id: 50, chat: { id: "123" } });

1031+

botApi.sendMessage.mockResolvedValue({ message_id: 51, chat: { id: "123" } });

9981032

const markdown = markdownTable(21);

999103310001034

await sendMessageTelegram("123", markdown, {

@@ -1009,7 +1043,7 @@ describe("sendMessageTelegram", () => {

10091043

});

1010104410111045

it("leaves wide rich markdown tables alone inside fences", async () => {

1012-

botApi.sendMessage.mockResolvedValue({ message_id: 51, chat: { id: "123" } });

1046+

botApi.sendMessage.mockResolvedValue({ message_id: 52, chat: { id: "123" } });

10131047

const markdown = `~~~\n${markdownTable(25)}\n~~~`;

1014104810151049

await sendMessageTelegram("123", markdown, {

@@ -1046,7 +1080,9 @@ describe("sendMessageTelegram", () => {

1046108010471081

it("sends long rich markdown as one message", async () => {

10481082

botApi.sendMessage.mockResolvedValue({ message_id: 53, chat: { id: "123" } });

1049-

const markdown = `# Long\n\n${"**section** with _style_ and `code`\n".repeat(800)}`;

1083+

const line = "**section** with _style_ and `code`";

1084+

const markdown = `# Long\n\n${`${line}\n`.repeat(800)}`;

1085+

const expectedMarkdown = `# Long\n\n${`${line} \n`.repeat(799)}${line}\n`;

1050108610511087

await sendMessageTelegram("123", markdown, {

10521088

cfg: TELEGRAM_TEST_CFG,

@@ -1056,7 +1092,7 @@ describe("sendMessageTelegram", () => {

10561092

expect(botRawApi.sendRichMessage).toHaveBeenCalledTimes(1);

10571093

expect(botRawApi.sendRichMessage).toHaveBeenCalledWith({

10581094

chat_id: "123",

1059-

rich_message: { markdown },

1095+

rich_message: { markdown: expectedMarkdown },

10601096

});

10611097

});

10621098