commit 0df957f3c049cbad7aca03d5c64d659957a82b94
parent d6939060edba1491b35ab4f76baa74d58671ad2e
Author: Davide P. Cervone <dpvc@union.edu>
Date: Fri, 16 Jan 2015 09:48:00 -0500
Don't escape \n, \r, or \t in toMathML text output. (Issue #847.)
Diffstat:
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git 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+"<mrow />")}
}
- if (this.isToken) {return space + "<"+tag+attr+">"+data.join("")+"</"+tag+">"}
+ if (this.isToken || this.isChars) {return space + "<"+tag+attr+">"+data.join("")+"</"+tag+">"}
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 =