Skip to content

Commit 0df37d0

Browse files
authored
editorial: fix abstract-role handling in aria.js (#2559)
1 parent 3ff610f commit 0df37d0

File tree

1 file changed

+6
-6
lines changed

1 file changed

+6
-6
lines changed

common/script/aria.js

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -104,8 +104,8 @@ const rewriteRdef = function (item) {
104104
const content = item.innerHTML;
105105
let title = item.getAttribute("title") || content;
106106
let type = "role";
107-
const abstract = item.parentNode.querySelectorAll(".role-abstract"); //TODO: maybe #105
108-
if (abstract.innerText === "True") {
107+
const abstract = item.parentNode.querySelector(".role-abstract");
108+
if (abstract?.innerText === "True") {//NOTE: optional chaining b/c synonym roles do not have characteristics tables
109109
type = "abstract role";
110110
}
111111
const dRef = item.nextElementSibling;
@@ -192,8 +192,8 @@ const renderRoleIndexEntry = function (item) {
192192
// is this a role or an abstract role
193193
let type = "role";
194194
let isAbstract = false;
195-
const abstract = container.querySelectorAll(".role-abstract"); //TODO: maybe #105
196-
if (abstract.innerText === "True") {
195+
const abstract = container.querySelector(".role-abstract");
196+
if (abstract?.innerText === "True") {//NOTE: optional chaining b/c synonym roles do not have characteristics tables
197197
type = "abstract role";
198198
isAbstract = true;
199199
}
@@ -256,8 +256,8 @@ const renderIndexEntry = (indexTest, rdef) => {
256256
const roleFromNode = container.querySelector(".role-namefrom");
257257
// is this a role or an abstract role
258258
let isAbstract = false;
259-
const abstract = container.querySelectorAll(".role-abstract"); //TODO: maybe #105
260-
if (abstract.innerText === "True") {
259+
const abstract = container.querySelector(".role-abstract");
260+
if (abstract?.innerText === "True") {//NOTE: optional chaining b/c synonym roles do not have characteristics tables
261261
isAbstract = true;
262262
}
263263
if (!isAbstract && roleFromNode) {

0 commit comments

Comments
 (0)