-
Notifications
You must be signed in to change notification settings - Fork 0
Closed
Labels
bugSomething isn't workingSomething isn't workingenhancementNew feature or requestNew feature or request
Description
I had filed Speech-Rule-Engine/speech-rule-engine#801 but it turns out it's sre2tree's fault.
The use case was \href{a}{b, c}
.
While sre2tree handles the skeleton node not being the root here:
Lines 124 to 125 in 48503b2
export const sre2tree = (node) => { | |
const skeletonNode = node.querySelector('[data-semantic-id]:not([data-semantic-parent])'); |
in this case it (re)moves the relevant attributes in
Lines 100 to 111 in 48503b2
// rewrite (proper) links | |
// NOTE. Since MathJax does not support <a> in internal format, the SRE structure is placed inside the a. We assume it's on the first semantic child | |
const firstSemanticChild = child.querySelector('[data-semantic-speech]'); | |
if (!firstSemanticChild) { | |
console.warn('Link without semantic child'); | |
return; | |
} | |
// move all attributes | |
[...firstSemanticChild.attributes].forEach(attr => { | |
child.setAttribute(attr.name, attr.value); | |
firstSemanticChild.removeAttribute(attr.name); | |
}) |
(since the anchor is the parent of the skeleton node)
So when we get to
Lines 136 to 143 in 48503b2
if (node !== skeletonNode) { | |
moveAttribute(skeletonNode, node, 'data-owns'); | |
moveAttribute(skeletonNode, node, 'aria-label'); | |
moveAttribute(skeletonNode, node, 'aria-braillelabel'); | |
moveAttribute(skeletonNode, node, 'aria-level'); | |
skeletonNode.removeAttribute('aria-hidden'); | |
skeletonNode.setAttribute('role', 'presentation'); | |
} |
the skeleton node no longer has the attributes we're trying to move.
Metadata
Metadata
Assignees
Labels
bugSomething isn't workingSomething isn't workingenhancementNew feature or requestNew feature or request