From 2ad0280c14857d1585ece73d87d417d4f7164081 Mon Sep 17 00:00:00 2001 From: Leo McArdle Date: Fri, 2 Feb 2024 16:54:15 +0000 Subject: [PATCH] wip(curriculum): remove phantom empty item from TOC --- build/utils.ts | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) diff --git a/build/utils.ts b/build/utils.ts index 213827cbe290..861e4ffa94de 100644 --- a/build/utils.ts +++ b/build/utils.ts @@ -324,13 +324,12 @@ export function makeTOC(doc, withH3 = false) { return doc.body .map((section) => { if ( - ((section.type === "prose" || + (section.type === "prose" || section.type === "browser_compatibility" || section.type === "specifications") && - section.value.id && - section.value.title && - !section.value.isH3) || - withH3 + section.value.id && + section.value.title && + (!section.value.isH3 || withH3) ) { return { text: section.value.title, id: section.value.id }; }