fix(search): ignore mathml block

This commit is contained in:
Aaron Pham 2024-11-13 10:55:08 -05:00 committed by GitHub
parent 137d55eb1b
commit dd1e26ba42
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -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" })
}