Mismatch between aria-describedby and rendered icons

Created on 9 September 2025, 1 day ago

Problem
When using the Link Purpose Icon (LPI) module, links that are both:

File download links (e.g., PDFs), and
Configured to open in a new tab (target="_blank")
should display two icons (document + external).

Currently, only the document icon is displayed, but the link’s aria-describedby contains two IDs — one for document and one for external. This results in a mismatch between what screen readers announce and what sighted users see.

Steps to reproduce

Enable the Link Purpose Icon module.
Add a file link (e.g., PDF) with target="_blank".
Inspect the output.

Example:

<a href="/sites/abc.com/files/2021-04/job.pdf"
   target="_blank" rel="nofollow" class="link-purpose blank"
   aria-describedby="link-purpose-description-41 link-purpose-description-42">
  abc
  <span class="link-purpose-icon link-purpose-document-icon" aria-hidden="true" title="Link downloads document">…</span>
  <span class="link-purpose-text" id="link-purpose-description-41">
    Link downloads document, Link opens in new window
  </span>
</a>


Observed behavior

aria-describedby references two IDs.
Only the document/download icon is rendered.
No external/new tab icon is rendered for the second description.
Screen readers announce “Link downloads document, Link opens in new window”, but sighted users only see the document icon.

Expected behavior

Both icons (document + external) should render when a link meets both conditions.
The aria-describedby entries should match visible icons.
Screen reader and visual output should be consistent.

Impact

Creates accessibility failures (inconsistent experience).
Triggers Pope.Tech / axe errors because of missing icon markup referenced by aria-describedby.

Proposed resolution

Update module logic to render multiple icons when aria-describedby references multiple descriptions.
Ensure each aria-describedby reference has a corresponding icon in the DOM.

Environment

Drupal core: 11.1.8
Link Purpose Icon module: 1.0.19
Testing tools: WAVE

🐛 Bug report
Status

Active

Version

1.0

Component

Bugs

Created by

🇺🇸United States chamilsanjeewa

Live updates comments and jobs are added and updated live.
Sign in to follow issues

Comments & Activities

Production build 0.71.5 2024