Composio powers 1000+ toolkits, tool search, context management, authentication, and a sandboxed workbench to help you build AI agents that turn intent into action.
fix(docs): escape pipes in generated text
jkomyno committed
Aug 26, 2026 at 19:55 UTC
c0880764cf6b0dff9521333216ec6b7f2622e7cf
2 files changed
+4
-3
ts/packages/core/scripts/generate-docs.ts
+1
@@ -1007,6 +1007,7 @@ function toKebabCase(str: string): string {
1007
export function escapeTextForMdx(str: string): string {
1008
return str
1009
.replace(/\\/g, '\\\\')
1010
+ .replace(/\|/g, '\\|')
1011
.replace(/\{/g, '\\{')
1012
.replace(/\}/g, '\\}')
1013
.replace(/</g, '<')
ts/packages/core/test/scripts/generate-docs.test.ts
+3
-3
@@ -38,9 +38,9 @@ describe('generate-docs type rendering', () => {
38
expect(escapeTypeForMdx(String.raw`{ pattern: '\|' }`)).toBe(String.raw`\{ pattern: '\\\|' \}`);
39
});
40
41
- it('escapes existing backslashes before MDX text metacharacters', () => {
42
- expect(escapeTextForMdx(String.raw`Use \{value\} or <literal>`)).toBe(
43
- String.raw`Use \\\{value\\\} or <literal>`
41
+ it('escapes existing backslashes before MDX text and table metacharacters', () => {
42
+ expect(escapeTextForMdx(String.raw`Use \{value\}, \|, or <literal>`)).toBe(
43
+ String.raw`Use \\\{value\\\}, \\\|, or <literal>`
44
);
45
});
46