Fix indenting of toMathML output.
This commit is contained in:
parent
9fd243d9bd
commit
d6b6b2e249
|
@ -147,7 +147,7 @@ MathJax.Hub.Register.LoadHook("[MathJax]/jax/element/mml/jax.js",function () {
|
||||||
{annotation = MathJax.InputJax[jax.inputJax].annotationEncoding}
|
{annotation = MathJax.InputJax[jax.inputJax].annotationEncoding}
|
||||||
var nested = (this.data[0] && this.data[0].data.length > 1);
|
var nested = (this.data[0] && this.data[0].data.length > 1);
|
||||||
var tag = this.type, attr = this.toMathMLattributes();
|
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++) {
|
for (var i = 0, m = this.data.length; i < m; i++) {
|
||||||
if (this.data[i]) {data.push(this.data[i].toMathML(SPACE))}
|
if (this.data[i]) {data.push(this.data[i].toMathML(SPACE))}
|
||||||
else {data.push(SPACE+"<mrow />")}
|
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) {
|
var xmlEscapedTex = jax.originalText.replace(/[&<>]/g, function(item) {
|
||||||
return { '>': '>', '<': '<','&': '&' }[item]
|
return { '>': '>', '<': '<','&': '&' }[item]
|
||||||
});
|
});
|
||||||
data.push(space+' <annotation encoding="'+annotation+'">'+xmlEscapedTex+"</annotation>");
|
data.push(space+' <annotation encoding="'+annotation+'">'+xmlEscapedTex+"</annotation>");
|
||||||
data.push(space+" </semantics>");
|
data.push(space+" </semantics>");
|
||||||
}
|
}
|
||||||
return space+"<"+tag+attr+">\n"+data.join("\n")+"\n"+space+"</"+tag+">";
|
return space+"<"+tag+attr+">\n"+data.join("\n")+"\n"+space+"</"+tag+">";
|
||||||
|
|
Loading…
Reference in New Issue
Block a user