quarto-ext / fontawesome

Use Font Awesome icons in HTML and PDF documents.
MIT License
97 stars 11 forks source link

`aria-label` option won't override default for icon? #26

Closed kthayashi closed 1 year ago

kthayashi commented 1 year ago

Perhaps this is stemming from a lack of knowledge on my part, but I'm having trouble specifying an aria-label for an icon obtained using shortcode. A simple example is: {{< fa volume-high title="listen" aria-label="listen" >}}. Running quarto preview and inspecting the source code for the icon in a web browser (I've tried both Firefox 114.0.1 and Safari 16.5), I get: <i class="fa-solid fa-volume-high" title="listen" aria-label="volume-high"></i>. It appears that the aria-label that I specified in the shortcode has failed to override the aria-label that is seemingly pre-associated with the icon. Is there any known way to specify my own aria-label in this way? I'm using quarto 1.3.433 on MacOS Ventura 13.4.

cscheid commented 1 year ago

It appears that the aria-label that I specified in the shortcode has failed to override the aria-label that is seemingly pre-associated with the icon. Is there any known way to specify my own aria-label in this way? I'm using quarto 1.3.433 on MacOS Ventura 13.4.

Use label instead: https://github.com/quarto-ext/fontawesome/blob/main/_extensions/fontawesome/fontawesome.lua#L53

kthayashi commented 1 year ago

Fantastic, thank you very much for the tip!