File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -5,7 +5,7 @@ import mdx from '@astrojs/mdx'
55import sitemap from '@astrojs/sitemap'
66import type { AstroIntegration } from 'astro'
77import autoImport from 'astro-auto-import'
8- import type { Element } from 'hast'
8+ import type { Element , Text } from 'hast'
99import rehypeAutolinkHeadings from 'rehype-autolink-headings'
1010import { getConfig } from './config'
1111import { rehypeBsTable } from './rehype'
@@ -59,7 +59,10 @@ export function bootstrap(): AstroIntegration[] {
5959 {
6060 behavior : 'append' ,
6161 content : [ { type : 'text' , value : ' ' } ] ,
62- properties : { class : 'anchor-link' } ,
62+ properties : ( element : Element ) => ( {
63+ class : 'anchor-link' ,
64+ ariaLabel : `Link to this section: ${ ( element . children [ 0 ] as Text ) . value } `
65+ } ) ,
6366 test : ( element : Element ) => element . tagName . match ( headingsRangeRegex )
6467 }
6568 ] ,
You can’t perform that action at this time.
0 commit comments