From 23df17233da3f16db5166cf8a05b2089bd1f006a Mon Sep 17 00:00:00 2001
From: Jacky Zhao <j.zhao2k19@gmail.com>
Date: Mon, 10 Mar 2025 18:39:08 +0000
Subject: [PATCH] fix(graph): make graph non-singleton, proper cleanup, fix radial
---
quartz/components/scripts/search.inline.ts | 4 ++--
1 files changed, 2 insertions(+), 2 deletions(-)
diff --git a/quartz/components/scripts/search.inline.ts b/quartz/components/scripts/search.inline.ts
index c9bbcce..1f4c009 100644
--- a/quartz/components/scripts/search.inline.ts
+++ b/quartz/components/scripts/search.inline.ts
@@ -384,7 +384,7 @@
preview.replaceChildren(previewInner)
// scroll to longest
- const highlights = [...preview.querySelectorAll(".highlight")].sort(
+ const highlights = [...preview.getElementsByClassName("highlight")].sort(
(a, b) => b.innerHTML.length - a.innerHTML.length,
)
highlights[0]?.scrollIntoView({ block: "start" })
@@ -488,7 +488,7 @@
document.addEventListener("nav", async (e: CustomEventMap["nav"]) => {
const currentSlug = e.detail.url
const data = await fetchData
- const searchElement = document.querySelectorAll(".search")
+ const searchElement = document.getElementsByClassName("search")
for (const element of searchElement) {
await setupSearch(element, currentSlug, data)
}
--
Gitblit v1.10.0