fix(theme): add bulletin to outline ignores (#879)

This commit is contained in:
pengzhanbo 2026-04-02 20:48:10 +08:00 committed by GitHub
parent aede6f5d87
commit 1b213d4c28
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -104,6 +104,8 @@ export function useHeaders(): Ref<MenuItem[]> {
return headers
}
const IGNORE_WRAPPERS = ['.vp-bulletin', '.vp-demo-wrapper']
/**
* Get headers from the page content
* Extracts and filters headings based on the outline configuration
@ -117,7 +119,7 @@ export function useHeaders(): Ref<MenuItem[]> {
export function getHeaders(range?: ThemeOutline): MenuItem[] {
const heading = ['h1', 'h2', 'h3', 'h4', 'h5', 'h6']
const ignores = Array.from(document.querySelectorAll(
heading.map(h => `.vp-demo-wrapper ${h}`).join(','),
heading.map(h => IGNORE_WRAPPERS.map(w => `${w} ${h}`)).flat().join(','),
))
const headers = Array.from(
document.querySelectorAll(heading.map(h => `.vp-doc ${h}`).join(',')),