From f8d81e377c0ee10b59155565e609b1a74113ed1b Mon Sep 17 00:00:00 2001 From: Alija Sabic Date: Mon, 6 Mar 2023 11:56:50 +0100 Subject: [PATCH] Provide accessible markdown-it-anchor configuration --- src/node/markdown/markdown.ts | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/src/node/markdown/markdown.ts b/src/node/markdown/markdown.ts index 54b8edc1..53a4e85d 100644 --- a/src/node/markdown/markdown.ts +++ b/src/node/markdown/markdown.ts @@ -99,7 +99,11 @@ export const createMarkdownRenderer = async ( // mdit-vue plugins md.use(anchorPlugin, { slugify, - permalink: anchorPlugin.permalink.ariaHidden({}), + permalink: anchorPlugin.permalink.linkAfterHeader({ + style: 'aria-label', + assistiveText: (title) => `Permalink to "${title}"`, + wrapper: ['
', '
'] + }), ...options.anchor } as anchorPlugin.AnchorOptions).use(frontmatterPlugin, { ...options.frontmatter