From e471c8b393847c231b1d42c387c4d5decc6b9a70 Mon Sep 17 00:00:00 2001 From: Kamran Ahmed Date: Mon, 18 Aug 2025 18:01:52 +0100 Subject: [PATCH] Fix table of contents issue --- src/lib/guide-renderer.tsx | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/src/lib/guide-renderer.tsx b/src/lib/guide-renderer.tsx index ac60f8768..78f05e29c 100644 --- a/src/lib/guide-renderer.tsx +++ b/src/lib/guide-renderer.tsx @@ -69,12 +69,6 @@ export class GuideRenderer { } }); - if (toc.length > 5) { - toc.forEach((group) => { - group.children = []; - }); - } - const qaSection = node.content?.find((node) => node.type === 'qaSection'); if (hasQASection && qaSection) { toc.push({ @@ -122,6 +116,12 @@ export class GuideRenderer { }); } + if (toc.length > 5) { + toc.forEach((group) => { + group.children = []; + }); + } + return toc; }