Skip to content

Commit 1ca5a57

Browse files
committed
fix(markdown-it-anchor): Add aria-label in anchors
1 parent 815712e commit 1ca5a57

File tree

2 files changed

+12
-1
lines changed

2 files changed

+12
-1
lines changed

Diff for: config/chainMarkdown.js

+9
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
function chainMarkdown (config) {
2+
config
3+
.plugin('anchor')
4+
.tap(([options]) => [
5+
Object.assign(options, { permalinkAttrs: () => ({ 'aria-label': 'Anchor' }) })
6+
])
7+
}
8+
9+
module.exports = chainMarkdown

Diff for: index.js

+3-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,8 @@
11
const plugins = require('./config/plugins')
2+
const chainMarkdown = require('./config/chainMarkdown')
23

34
module.exports = {
45
extend: '@vuepress/theme-default',
5-
plugins
6+
plugins,
7+
chainMarkdown
68
}

0 commit comments

Comments
 (0)