mirror of
https://github.com/openclaw/openclaw.git
synced 2026-05-06 08:09:35 +00:00
fix: enforce telegram shared outbound chunking
This commit is contained in:
@@ -158,6 +158,14 @@ describe("markdownToTelegramChunks - file reference wrapping", () => {
|
||||
expect(chunks[0].html).toContain("<code>README.md</code>");
|
||||
expect(chunks[0].html).toContain("<code>backup.sh</code>");
|
||||
});
|
||||
|
||||
it("keeps rendered html chunks within the provided limit", () => {
|
||||
const input = "<".repeat(1500);
|
||||
const chunks = markdownToTelegramChunks(input, 512);
|
||||
expect(chunks.length).toBeGreaterThan(1);
|
||||
expect(chunks.map((chunk) => chunk.text).join("")).toBe(input);
|
||||
expect(chunks.every((chunk) => chunk.html.length <= 512)).toBe(true);
|
||||
});
|
||||
});
|
||||
|
||||
describe("edge cases", () => {
|
||||
|
||||
Reference in New Issue
Block a user