Skip to content

Commit 1d99e5b

Browse files
committed
docs(useToc): exclude headings inside dialogs
1 parent 4ca09a4 commit 1d99e5b

File tree

1 file changed

+2
-0
lines changed

1 file changed

+2
-0
lines changed

apps/docs/src/composables/useToc.ts

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -117,6 +117,8 @@ export function useToc (options: UseTocOptions = {}): UseTocReturn {
117117
let currentH3: TocHeading | null = null
118118

119119
for (const el of elements) {
120+
if (el.closest('[role="dialog"]')) continue
121+
120122
const id = el.id
121123
const text = el.textContent?.trim() ?? ''
122124
const level = el.tagName === 'H2' ? 2 : (el.tagName === 'H3' ? 3 : 4)

0 commit comments

Comments
 (0)