Skip to content

Commit 2cf7459

Browse files
authored
Merge pull request #1425 from mathjax/issue3511
Fix speech attachment for SVG inline expressions with line breaks. (mathjax/MathJax#3511)
2 parents b189f7e + d30e438 commit 2cf7459

File tree

1 file changed

+5
-7
lines changed

1 file changed

+5
-7
lines changed

ts/a11y/speech/WebWorker.ts

Lines changed: 5 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -334,13 +334,11 @@ export class WorkerHandler<N, T, D> {
334334
adaptor.setAttribute(node, 'data-semantic-type', 'dummy');
335335
this.setSpecialAttributes(node, sid, '');
336336
}
337-
this.setSpeechAttributes(
338-
adaptor.childNodes(container)[0],
339-
'',
340-
data,
341-
speech,
342-
braille
343-
);
337+
for (const child of adaptor.childNodes(container)) {
338+
if (adaptor.kind(child) === 'mjx-math' || adaptor.kind(child) === 'svg') {
339+
this.setSpeechAttributes(child, '', data, speech, braille);
340+
}
341+
}
344342
if (speech) {
345343
if (data.label) {
346344
adaptor.setAttribute(container, SemAttr.SPEECH, data.label);

0 commit comments

Comments
 (0)