fix(a11y): hide duplicated link text from screen readers
Some checks failed
Lint / Lint files (push) Has been cancelled
Build & run tests / Node 18 (push) Has been cancelled
Build & run tests / Node 20 (push) Has been cancelled

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 <github@erik.michelson.eu>
This commit is contained in:
Erik Michelson 2024-08-09 17:56:38 +02:00 committed by Philip Molares
parent 858d7bf5d1
commit bf740ad910
2 changed files with 2 additions and 0 deletions

View file

@ -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
## <i class="fa fa-tag"></i> 1.9.9 <i class="fa fa-calendar-o"></i> 2023-07-30

View file

@ -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 = '<i class="fa fa-link"></i>'