From 06c4b11e8f14790e2abe83e2ffb7f8aa5099b4f5 Mon Sep 17 00:00:00 2001 From: Tejas Sanap Date: Sun, 11 Aug 2024 21:19:47 +0100 Subject: [PATCH] fix selectors for toc --- quartz/components/scripts/toc.inline.ts | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/quartz/components/scripts/toc.inline.ts b/quartz/components/scripts/toc.inline.ts index acc81b20d..d8160e2c3 100644 --- a/quartz/components/scripts/toc.inline.ts +++ b/quartz/components/scripts/toc.inline.ts @@ -27,8 +27,8 @@ function toggleToc(this: HTMLElement) { } function setupToc() { - const toc = document.getElementById("toc") - if (toc) { + const buttons = document.querySelectorAll("button#toc") as NodeListOf + for (const toc of buttons) { const collapsed = toc.classList.contains("collapsed") const content = toc.nextElementSibling as HTMLElement | undefined if (!content) return