From 2756525e7312e53a6b9c5c2936101c9be58aab3c Mon Sep 17 00:00:00 2001 From: "Davide P. Cervone" Date: Sat, 12 Sep 2015 06:58:06 -0400 Subject: [PATCH] Make sure aria attributes use setAttribute so they appear properly in the DOM --- unpacked/MathJax.js | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/unpacked/MathJax.js b/unpacked/MathJax.js index f81670339..62fba32df 100644 --- a/unpacked/MathJax.js +++ b/unpacked/MathJax.js @@ -1048,10 +1048,11 @@ MathJax.HTML = { {def.style[id.replace(/-([a-z])/g,this.ucMatch)] = style[id]}} } MathJax.Hub.Insert(obj,def); + for (var id in def) {if (id.substr(0,5) === "aria-") obj.setAttribute(id,def[id])} } if (contents) { if (!(contents instanceof Array)) {contents = [contents]} - for (var i = 0; i < contents.length; i++) { + for (var i = 0, m = contents.length; i < m; i++) { if (contents[i] instanceof Array) { obj.appendChild(this.Element(contents[i][0],contents[i][1],contents[i][2])); } else if (type === "script") { // IE throws an error if script is added as a text node