mirror of
https://github.com/jackyzha0/quartz.git
synced 2025-05-18 14:34:23 +02:00
fix(search): ignore mathml block
This commit is contained in:
parent
137d55eb1b
commit
dd1e26ba42
@ -394,9 +394,9 @@ document.addEventListener("nav", async (e: CustomEventMap["nav"]) => {
|
||||
preview.replaceChildren(previewInner)
|
||||
|
||||
// scroll to longest
|
||||
const highlights = [...preview.querySelectorAll(".highlight")].sort(
|
||||
(a, b) => b.innerHTML.length - a.innerHTML.length,
|
||||
)
|
||||
const highlights = [...preview.querySelectorAll(".highlight")]
|
||||
.filter((highlight) => !highlight.closest(".katex, .katex-mathml"))
|
||||
.sort((a, b) => b.innerHTML.length - a.innerHTML.length)
|
||||
highlights[0]?.scrollIntoView({ block: "start" })
|
||||
}
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user