Skip to content

armgit / cindy

Public Imported from GitHub
0

Consider it done. The open-source AI agent that works out of the box · 想到,就能做到。开源、开箱即用的 AI Agent。

test(im): guard single-pass Telegram entity decoding

Zhao Dengfeng91bb7741ed5e
diff --git a/packages/lizi-im/src/telegram/__tests__/markdown.test.ts b/packages/lizi-im/src/telegram/__tests__/markdown.test.ts
index c5f2d152d4..f03488f667 100644
--- a/packages/lizi-im/src/telegram/__tests__/markdown.test.ts
+++ b/packages/lizi-im/src/telegram/__tests__/markdown.test.ts
@@ -14,6 +14,8 @@ describe('markdownToTelegramHtml', () => {
const { html } = markdownToTelegramHtml('A & B < C');
expect(stripTelegramHtmlTags(html)).toBe('A & B < C');
expect(stripTelegramHtmlTags('&lt;b&gt;')).toBe('<b>');
+ // 只解码渲染新增的一层,保留用户原文中的实体拼写。
+ expect(stripTelegramHtmlTags('&amp;lt;b&amp;gt;')).toBe('&lt;b&gt;');
});
it('粗体/斜体/删除线/行内 code', () => {