From 44326ca423b25ddbb12b172ab7180edd553c61f4 Mon Sep 17 00:00:00 2001 From: Luffy Date: Wed, 17 Dec 2025 17:20:48 +0800 Subject: [PATCH] fix: include h6 headings in heading element selection (#2649) --- src/core/event/index.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/core/event/index.js b/src/core/event/index.js index 9d7a1b3b1..f92c38e5b 100644 --- a/src/core/event/index.js +++ b/src/core/event/index.js @@ -76,7 +76,7 @@ export function Events(Base) { * @void */ #initHeadings() { - const headingElms = dom.findAll('#main :where(h1, h2, h3, h4, h5)'); + const headingElms = dom.findAll('#main :where(h1, h2, h3, h4, h5, h6)'); const headingsInView = new Set(); let isInitialLoad = true; @@ -361,7 +361,7 @@ export function Events(Base) { // Anchor link if (query.id) { const headingElm = dom.find( - `.markdown-section :where(h1, h2, h3, h4, h5)[id="${query.id}"]`, + `.markdown-section :where(h1, h2, h3, h4, h5, h6)[id="${query.id}"]`, ); if (headingElm) {