diff --git a/unpacked/extensions/toMathML.js b/unpacked/extensions/toMathML.js index 40d19f59c..b32fcb6a2 100644 --- a/unpacked/extensions/toMathML.js +++ b/unpacked/extensions/toMathML.js @@ -43,7 +43,7 @@ MathJax.Hub.Register.LoadHook("[MathJax]/jax/element/mml/jax.js",function () { if (this.data[i]) {data.push(this.data[i].toMathML(SPACE))} else if (!this.isToken && !this.isChars) {data.push(SPACE+"")} } - if (this.isToken) {return space + "<"+tag+attr+">"+data.join("")+""} + if (this.isToken || this.isChars) {return space + "<"+tag+attr+">"+data.join("")+""} if (inferred) {return data.join("\n")} if (data.length === 0 || (data.length === 1 && data[0] === "")) {return space + "<"+tag+attr+" />"} @@ -109,7 +109,7 @@ MathJax.Hub.Register.LoadHook("[MathJax]/jax/element/mml/jax.js",function () { if (n <= 0xD7FF || 0xE000 <= n) { // Code points U+0000 to U+D7FF and U+E000 to U+FFFF. // They are directly represented by n. - if (n < 0x20 || n > 0x7E) { + if (n > 0x7E || (n < 0x20 && n !== 0x0A && n !== 0x0D && n !== 0x08)) { string[i] = "&#x"+n.toString(16).toUpperCase()+";"; } else { var c =