Skip to content

Commit 6ced25b

Browse files
committed
chore: fix regex in getTokensText()
was not matching more than one argument of a function
1 parent 025e302 commit 6ced25b

File tree

1 file changed

+4
-3
lines changed

1 file changed

+4
-3
lines changed

docs/.vitepress/config.js

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -10,16 +10,17 @@ export default {
1010
markdown: {
1111
anchor: {
1212
getTokensText: tokens => {
13-
return tokens
13+
const tokensText = tokens
1414
.filter(t => t.type === 'text' && t.info !== 'entity' && t.content)
1515
.map(t => t.content)
1616
.join('')
17-
.replace(/\s.*$/, '');
17+
.replace(/(?!\s.+\))\s.*$/, '')
18+
.replace('(', '-');
19+
return tokensText;
1820
},
1921
permalink: anchor.permalink.ariaHidden({
2022
symbol: '§',
2123
}),
2224
},
23-
// anchor: { permalink: true, permalinkBefore: true, permalinkSymbol: '🔗' },
2425
},
2526
};

0 commit comments

Comments
 (0)