mirror of
https://github.com/openclaw/openclaw.git
synced 2026-05-07 02:21:37 +00:00
fix: preserve whitespace in telegram html retry chunking
This commit is contained in:
@@ -166,6 +166,14 @@ describe("markdownToTelegramChunks - file reference wrapping", () => {
|
||||
expect(chunks.map((chunk) => chunk.text).join("")).toBe(input);
|
||||
expect(chunks.every((chunk) => chunk.html.length <= 512)).toBe(true);
|
||||
});
|
||||
|
||||
it("preserves whitespace when html-limit retry splitting runs", () => {
|
||||
const input = "a < b";
|
||||
const chunks = markdownToTelegramChunks(input, 5);
|
||||
expect(chunks.length).toBeGreaterThan(1);
|
||||
expect(chunks.map((chunk) => chunk.text).join("")).toBe(input);
|
||||
expect(chunks.every((chunk) => chunk.html.length <= 5)).toBe(true);
|
||||
});
|
||||
});
|
||||
|
||||
describe("edge cases", () => {
|
||||
|
||||
Reference in New Issue
Block a user