Skip to content

Commit

Permalink
Accessibility text missing for all but last link that opens in new tab
Browse files Browse the repository at this point in the history
* Creating separate elements for each link

Fixes #2744, SITES-23879
  • Loading branch information
vladbailescu authored Aug 5, 2024
1 parent 3d1b22b commit 859a92f
Showing 1 changed file with 3 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -38,11 +38,11 @@
function onDocumentReady() {
var linkAccessibilityText = getLinkAccessibilityText();
if (linkAccessibilityText) {
var linkAccessibilityElement = document.createElement("span");
linkAccessibilityElement.classList.add(linkAccessibilityClass);
linkAccessibilityElement.innerText = linkAccessibilityText;
document.querySelectorAll("a[target='_blank']").forEach(function(link) {
if (!link.querySelector(selectors.linkAccessibility)) {
var linkAccessibilityElement = document.createElement("span");
linkAccessibilityElement.classList.add(linkAccessibilityClass);
linkAccessibilityElement.innerText = linkAccessibilityText;
link.insertAdjacentElement("beforeend", linkAccessibilityElement);
}
});
Expand Down

0 comments on commit 859a92f

Please sign in to comment.