Skip to content

Commit

Permalink
Generated by 5863d2156ed5dd9b66b6a957575af825643f1ecb
Browse files Browse the repository at this point in the history
  • Loading branch information
github-actions[bot] committed Nov 19, 2021
1 parent ecbf3d5 commit 54cd3ff
Showing 1 changed file with 10 additions and 4 deletions.
14 changes: 10 additions & 4 deletions common/script/aria.js
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,6 @@
var roleInfo = {};

function ariaAttributeReferences() {
{
var propList = {};
var globalSP = [];

Expand Down Expand Up @@ -46,7 +45,7 @@ function ariaAttributeReferences() {
'</span>';
sp.setAttribute('aria-describedby', 'desc-' + title);
var dRef = item.nextElementSibling;
var desc = dRef.firstElementChild.innerHTML;
var desc = cloneWithoutIds(dRef.firstElementChild).innerHTML;
dRef.id = 'desc-' + title;
dRef.setAttribute('role', 'definition');
var heading = document.createElement('h4');
Expand Down Expand Up @@ -255,7 +254,7 @@ function ariaAttributeReferences() {
// sp.id = title;
sp.setAttribute('aria-describedby', 'desc-' + title);
var dRef = item.nextElementSibling;
var desc = dRef.firstElementChild.innerHTML;
var desc = cloneWithoutIds(dRef.firstElementChild).innerHTML;
dRef.id = 'desc-' + title;
dRef.setAttribute('role', 'definition');
container.replaceChild(sp, item);
Expand Down Expand Up @@ -745,7 +744,14 @@ function ariaAttributeReferences() {
});

updateReferences(document);
}

function cloneWithoutIds(node) {
const clone = node.cloneNode(true);
for (const elementWithId of clone.querySelectorAll("[id]")) {
elementWithId.removeAttribute("id");
}
return clone;
}
}

require(['core/pubsubhub'], function (respecEvents) {
Expand Down

0 comments on commit 54cd3ff

Please sign in to comment.