From 1b213d4c28a7416e9be48af061f43142533bf387 Mon Sep 17 00:00:00 2001 From: pengzhanbo Date: Thu, 2 Apr 2026 20:48:10 +0800 Subject: [PATCH] fix(theme): add bulletin to outline ignores (#879) --- theme/src/client/composables/outline.ts | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/theme/src/client/composables/outline.ts b/theme/src/client/composables/outline.ts index 843820dc..e7db6a9c 100644 --- a/theme/src/client/composables/outline.ts +++ b/theme/src/client/composables/outline.ts @@ -104,6 +104,8 @@ export function useHeaders(): Ref { 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 { 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(',')),