fix(messages): normalize escaped markdown newlines
This commit is contained in:
1 parent
6ce7e63c71
commit
31aac7c0de
9 files changed
+78
-7
No files matched your search
@@ -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");
|
||||
});
|
||||
});
|
||||
Reference in new issue
Block a user