Skip to content

Commit

Permalink
plainSource: snsure IE8 compatibility
Browse files Browse the repository at this point in the history
  • Loading branch information
pkra committed Dec 13, 2015
1 parent 040ddd6 commit fbd7d6e
Showing 1 changed file with 11 additions and 11 deletions.
22 changes: 11 additions & 11 deletions unpacked/jax/output/PlainSource/jax.js
Original file line number Diff line number Diff line change
Expand Up @@ -136,22 +136,22 @@
// Typeset the math
//
this.initPlainSource(math, span);
var source = jax.originalText;
if (jax.inputJax === "MathML") {
if ((jax.root.data[0].data.length > 0) && (jax.root.data[0].data[0].type === "semantics")) {
var annotations = jax.root.data[0].data[0].data.map(function(node) {
return node.attr.encoding;
});
var texIndex = annotations.indexOf("application/x-tex");
var asciiIndex = annotations.indexOf("text/x-asciimath");
if (texIndex > -1) {
source = jax.root.data[0].data[0].data[texIndex].data[0].data[0];
} else if (asciiIndex > -1) {
source = jax.root.data[0].data[0].data[asciiIndex].data[0].data[0];
var annotations = jax.root.data[0].data[0].data;
for (var a = 0; a < annotations.length; a++){
if (annotations[a].attr.encoding === "application/x-tex"){
source = jax.root.data[0].data[0].data[a].data[0].data[0];
break;
}
if (annotations[a].attr.encoding === "text/x-asciimath") {
source = jax.root.data[0].data[0].data[a].data[0].data[0];
}
}
}
} else {
span.innerHTML = jax.originalText;
}
span.innerHTML = source;

//
// Put it in place, and remove the processing marker
Expand Down

0 comments on commit fbd7d6e

Please sign in to comment.