fix(messages): normalize escaped markdown newlines

This commit is contained in:
ZacharyZhang-NY committed 2026-04-24 10:35:11 -04:00
1 parent 6ce7e63c71
commit 31aac7c0de
9 files changed
+78 -7

No files matched your search

+12
View File
@@ -0,0 +1,12 @@
import { describe, expect, it } from "vitest";
import { normalizeMarkdownText } from "../../src/shared/markdown-text";
describe("normalizeMarkdownText", () => {
it("converts escaped markdown line breaks into renderable markdown", () => {
expect(normalizeMarkdownText("Intro\\n\\n## Plan\\n- First\\n- Second")).toBe("Intro\n\n## Plan\n- First\n- Second");
});
it("normalizes actual CRLF input to LF", () => {
expect(normalizeMarkdownText("One\r\nTwo\rThree")).toBe("One\nTwo\nThree");
});
});