From c787f8f142717fbf4241e65e95c0adca7c01539b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ignacio=20Ferro=20Pic=C3=B3n?= Date: Thu, 23 Apr 2026 11:00:19 +0200 Subject: [PATCH] fix #59 --- apps/web/src/lib/docs.ts | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/apps/web/src/lib/docs.ts b/apps/web/src/lib/docs.ts index eb58b9b..5df3d6f 100644 --- a/apps/web/src/lib/docs.ts +++ b/apps/web/src/lib/docs.ts @@ -120,7 +120,17 @@ export function extractToc(source: string): TocItem[] { const items: TocItem[] = []; const lines = source.split("\n"); + let fence: string | null = null; for (const line of lines) { + const fenceMatch = line.match(/^(`{3,}|~{3,})/); + if (fenceMatch) { + const marker = fenceMatch[1][0]; + if (fence === null) fence = marker; + else if (fence === marker) fence = null; + continue; + } + if (fence !== null) continue; + const match = line.match(/^(#{1,3})\s+(.+)$/); if (!match) continue; const level = match[1].length;