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 22, 08:15 UTC
fix: skip headings inside fenced code blocks in heading extraction
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Sushmithamallesh committed
Feb 17, 2026 at 20:20 UTC
7bcdf8a8fbd6ed105857e603f6858fca85b3b234
1 file changed
+6
docs/scripts/validate-links.ts
+6
@@ -31,7 +31,13 @@ type PageOf = ReturnType<AnySource['getPages']>[number];
31
function extractHeadingsFromContent(content: string): string[] {
32
const slugger = new GithubSlugger();
33
const headings: string[] = [];
34
+ let inCodeBlock = false;
35
for (const line of content.split('\n')) {
36
+ if (line.startsWith('```')) {
37
+ inCodeBlock = !inCodeBlock;
38
+ continue;
39
+ }
40
+ if (inCodeBlock) continue;
41
const match = line.match(/^#{1,6}\s+(.+)$/);
42
if (match) {
43
headings.push(slugger.slug(match[1]));