File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -30,20 +30,21 @@ export default function astroStarlightRemarkAsides() {
3030 // logic to support :::tip{title="title"} syntax and default to Tip for :::tip
3131 let title = node . attributes . title || callout . title ;
3232
33- node . attributes = {
34- ...attributes ,
35- class : "class" in attributes
36- ? `callout callout-${ node . name } ${ attributes . class } `
37- : `callout callout-${ node . name } ` ,
38- } ;
39-
4033 // logic to support :::tip[title] syntax
4134 // remark-directive converts a container’s “label” to a paragraph at children[0] with the `directiveLabel` property set to true
4235 if ( node . children [ 0 ] . data ?. directiveLabel ) {
4336 title = node . children [ 0 ] . children [ 0 ] . value ;
4437 node . children . shift ( ) ;
4538 }
4639
40+ node . attributes = {
41+ ...attributes ,
42+ "aria-label" : title ,
43+ class : "class" in attributes
44+ ? `callout callout-${ node . name } ${ attributes . class } `
45+ : `callout callout-${ node . name } ` ,
46+ } ;
47+
4748 node . children = generate ( title , node . children , callout . icon ) ;
4849
4950 // TO DO: maybe get rid of h just make it set the classes in hProperties without needing hast
You can’t perform that action at this time.
0 commit comments