File tree 1 file changed +3
-8
lines changed
src/client/theme-default/composables
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'
5
5
import { throttleAndDebounce } from '../support/utils'
6
6
import { useAside } from './aside'
7
7
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
+
8
10
// cached list of anchor elements from resolveHeaders
9
11
const resolvedHeaders : { element : HTMLHeadElement ; link : string } [ ] = [ ]
10
12
@@ -45,14 +47,7 @@ function serializeHeader(h: Element): string {
45
47
let ret = ''
46
48
for ( const node of h . childNodes ) {
47
49
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
56
51
ret += node . textContent
57
52
} else if ( node . nodeType === 3 ) {
58
53
ret += node . textContent
You can’t perform that action at this time.
0 commit comments