@devries-cameron20 / composio-1 / commits / 5114ac375
Fork 0

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: add LLM markdown handlers for Figure and ToolType components

- Figure → markdown image with caption - ToolTypeOption → ### {name} section header - ToolTypeFlow, ToolkitsLanding → strip wrapper tags Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>

Sushmithamallesh committed Jan 25, 2026 at 22:51 UTC 5114ac3754ff8e428155fbdeb1e87b25cd278b34
1 file changed +20 -2
docs/lib/source.ts
+20 -2
@@ -128,8 +128,26 @@ function mdxToCleanMarkdown(content: string): string {
128 '\n**$1**\n$2'
129 );
130
131 - // Remove wrapper components (Cards, ProviderGrid, Tabs, Frame, div, QuickstartFlow, IntegrationTabs, Accordions, etc.)
132 - result = result.replace(/<\/?(Cards|ProviderGrid|Tabs|Frame|div|QuickstartFlow|IntegrationTabs|Accordions)[^>]*>/g, '');
131 + // Convert Figure to markdown image with caption
132 + result = result.replace(
133 + /<Figure[\s\S]*?src="([^"]*)"[\s\S]*?alt="([^"]*)"[\s\S]*?caption="([^"]*)"[\s\S]*?\/>/g,
134 + '![$2]($1)\n*$3*'
135 + );
136 + // Figure without caption
137 + result = result.replace(
138 + /<Figure[\s\S]*?src="([^"]*)"[\s\S]*?alt="([^"]*)"[\s\S]*?\/>/g,
139 + '![$2]($1)'
140 + );
141 +
142 + // Convert ToolTypeOption to labeled section (similar to IntegrationContent)
143 + result = result.replace(
144 + /<ToolTypeOption[\s\S]*?name="([^"]*)"[\s\S]*?>/g,
145 + '\n### $1\n'
146 + );
147 + result = result.replace(/<\/ToolTypeOption>/g, '');
148 +
149 + // Remove wrapper components (Cards, ProviderGrid, Tabs, Frame, div, QuickstartFlow, IntegrationTabs, Accordions, ToolTypeFlow, ToolkitsLanding, etc.)
150 + result = result.replace(/<\/?(Cards|ProviderGrid|Tabs|Frame|div|QuickstartFlow|IntegrationTabs|Accordions|ToolTypeFlow|ToolkitsLanding)[^>]*>/g, '');
151
152 // Remove remaining self-closing JSX tags (including those with JSX expressions)
153 result = result.replace(/<[A-Z][a-zA-Z]*[\s\S]*?\/>/g, '');