Skip to content

Composio powers 1000+ toolkits, tool search, context management, authentication, and a sandboxed workbench to help you build AI agents that turn intent into action.

docs: decode HTML entities in mermaid chart output for LLMs

Sushmitha Malleshcb21004e96fa
diff --git a/docs/lib/source.ts b/docs/lib/source.ts
index 210d9583e..7b171dd8d 100644
--- a/docs/lib/source.ts
+++ b/docs/lib/source.ts
@@ -416,7 +416,9 @@ ${page.data.description || ''}`;
const cleanSegments = segments.map(s => mdxToCleanMarkdown(s));
let cleanContent = cleanSegments[0];
for (let i = 0; i < mermaidCharts.length; i++) {
- cleanContent += `\n\n\`\`\`mermaid\n${mermaidCharts[i]}\n\`\`\`\n\n${cleanSegments[i + 1]}`;
+ // Decode HTML entities that fumadocs encodes in JSX attributes
+ const chart = mermaidCharts[i].replace(/&#x22;/g, '"').replace(/&#x27;/g, "'").replace(/&amp;/g, '&');
+ cleanContent += `\n\n\`\`\`mermaid\n${chart}\n\`\`\`\n\n${cleanSegments[i + 1]}`;
}
const footer = includeFooter