Composio powers 1000+ toolkits, tool search, context management, authentication, and a sandboxed workbench to help you build AI agents that turn intent into action.
Mirrored from https://github.com/Camo67/composio.git
Synced Nov 21, 03:37 UTC
| 1 | import { describe, expect, test } from "bun:test"; |
| 2 | |
| 3 | import { encodeMarkdownTableCell, encodeYamlString } from "../../lib/markdown-escaping"; |
| 4 | |
| 5 | describe("Markdown and frontmatter escaping", () => { |
| 6 | test("encodes every table delimiter without consuming existing backslashes", () => { |
| 7 | expect(encodeMarkdownTableCell(String.raw`first \| second | third`)).toBe( |
| 8 | String.raw`first \| second | third` |
| 9 | ); |
| 10 | }); |
| 11 | |
| 12 | test("collapses every line ending inside table cells", () => { |
| 13 | expect(encodeMarkdownTableCell("first\r\nsecond\rthird\nfourth")).toBe( |
| 14 | "first second third fourth" |
| 15 | ); |
| 16 | }); |
| 17 | |
| 18 | test("serializes quotes, backslashes, and control characters as a YAML string", () => { |
| 19 | expect(encodeYamlString('Use "quotes" at C:\\tools\nnext')).toBe( |
| 20 | '"Use \\"quotes\\" at C:\\\\tools\\nnext"' |
| 21 | ); |
| 22 | }); |
| 23 | }); |