Fix indenting of toMathML output.

This commit is contained in:
Davide P. Cervone 2015-01-05 11:04:55 -05:00
parent 9fd243d9bd
commit d6b6b2e249

View File

@ -147,7 +147,7 @@ MathJax.Hub.Register.LoadHook("[MathJax]/jax/element/mml/jax.js",function () {
{annotation = MathJax.InputJax[jax.inputJax].annotationEncoding}
var nested = (this.data[0] && this.data[0].data.length > 1);
var tag = this.type, attr = this.toMathMLattributes();
var data = [], SPACE = space + (annotation ? " " : "") + (nested ? " " : "");
var data = [], SPACE = space + (annotation ? " " + (nested ? " " : "") : "") + " ";
for (var i = 0, m = this.data.length; i < m; i++) {
if (this.data[i]) {data.push(this.data[i].toMathML(SPACE))}
else {data.push(SPACE+"<mrow />")}
@ -162,7 +162,7 @@ MathJax.Hub.Register.LoadHook("[MathJax]/jax/element/mml/jax.js",function () {
var xmlEscapedTex = jax.originalText.replace(/[&<>]/g, function(item) {
return { '>': '&gt;', '<': '&lt;','&': '&amp;' }[item]
});
data.push(space+' <annotation encoding="'+annotation+'">'+xmlEscapedTex+"</annotation>");
data.push(space+' <annotation encoding="'+annotation+'">'+xmlEscapedTex+"</annotation>");
data.push(space+" </semantics>");
}
return space+"<"+tag+attr+">\n"+data.join("\n")+"\n"+space+"</"+tag+">";