From bf740ad910148fceb8a8cd67c0dbab232bc6d954 Mon Sep 17 00:00:00 2001 From: Erik Michelson Date: Fri, 9 Aug 2024 17:56:38 +0200 Subject: [PATCH] fix(a11y): hide duplicated link text from screen readers Because screen readers don't know that the anchor icon is not meant to be read, they might read the title (which is the same as the heading itself) in addition to the heading, thus causing a duplicated output. Signed-off-by: Erik Michelson --- public/docs/release-notes.md | 1 + public/js/extra.js | 1 + 2 files changed, 2 insertions(+) diff --git a/public/docs/release-notes.md b/public/docs/release-notes.md index f9e65c9ac..b318c2b2d 100644 --- a/public/docs/release-notes.md +++ b/public/docs/release-notes.md @@ -10,6 +10,7 @@ - Fix a crash when having numeric-only values in opengraph frontmatter - Fix unnecessary session creation on healthcheck endpoint - Fix defect metadata being sent for minio uploads +- Fix screen readers announcing headings twice ## 1.9.9 2023-07-30 diff --git a/public/js/extra.js b/public/js/extra.js index d104b7072..a4d7d240a 100644 --- a/public/js/extra.js +++ b/public/js/extra.js @@ -845,6 +845,7 @@ function imgPlayiframe (element, src) { const anchorForId = id => { const anchor = document.createElement('a') + anchor.ariaHidden = 'true' anchor.className = 'anchor hidden-xs' anchor.href = `#${id}` anchor.innerHTML = ''