File tree Expand file tree Collapse file tree 1 file changed +3
-8
lines changed
src/client/theme-default/composables Expand file tree Collapse file tree 1 file changed +3
-8
lines changed Original file line number Diff line number Diff line change @@ -5,6 +5,8 @@ import type { Header } from '../../shared'
55import { throttleAndDebounce } from '../support/utils'
66import { useAside } from './aside'
77
8+ const ignoreRE = / \b (?: V P B a d g e | h e a d e r - a n c h o r | f o o t n o t e - r e f | i g n o r e - h e a d e r ) \b /
9+
810// cached list of anchor elements from resolveHeaders
911const resolvedHeaders : { element : HTMLHeadElement ; link : string } [ ] = [ ]
1012
@@ -45,14 +47,7 @@ function serializeHeader(h: Element): string {
4547 let ret = ''
4648 for ( const node of h . childNodes ) {
4749 if ( node . nodeType === 1 ) {
48- if (
49- ( node as Element ) . classList . contains ( 'VPBadge' ) ||
50- ( node as Element ) . classList . contains ( 'header-anchor' ) ||
51- ( node as Element ) . classList . contains ( 'footnote-ref' ) ||
52- ( node as Element ) . classList . contains ( 'ignore-header' )
53- ) {
54- continue
55- }
50+ if ( ignoreRE . test ( ( node as Element ) . className ) ) continue
5651 ret += node . textContent
5752 } else if ( node . nodeType === 3 ) {
5853 ret += node . textContent
You can’t perform that action at this time.
0 commit comments