1
mirror of https://github.com/jakejarvis/jarv.is.git synced 2025-07-21 11:41:18 -04:00

fix missing anchor link aria-label

This commit is contained in:
2021-12-01 16:05:38 -05:00
parent f7632e0071
commit ce1a24170a

View File

@@ -11,6 +11,7 @@ document.querySelectorAll(["div#content h2", "div#content h3", "div#content h4"]
const anchor = document.createElement("a"); const anchor = document.createElement("a");
anchor.className = "anchorjs-link"; anchor.className = "anchorjs-link";
anchor.href = `#${h.getAttribute("id")}`; anchor.href = `#${h.getAttribute("id")}`;
anchor.ariaLabel = "Anchor";
// if this is a touchscreen, always show the "#" icon instead waiting for hover // if this is a touchscreen, always show the "#" icon instead waiting for hover
// NOTE: this is notoriously unreliable; see https://github.com/Modernizr/Modernizr/pull/2432 // NOTE: this is notoriously unreliable; see https://github.com/Modernizr/Modernizr/pull/2432