www

Unnamed repository; edit this file 'description' to name the repository.
Log | Files | Refs | README | LICENSE

commit fbd7d6e9b0aee025666ac25da271f1d7f6a204de
parent 040ddd652c8c2c5b889e15abd974d13cc27ef76c
Author: Peter Krautzberger <p.krautzberger@gmail.com>
Date:   Sun, 13 Dec 2015 15:40:54 +0100

plainSource: snsure IE8 compatibility

Diffstat:
Munpacked/jax/output/PlainSource/jax.js | 22+++++++++++-----------
1 file changed, 11 insertions(+), 11 deletions(-)

diff --git a/unpacked/jax/output/PlainSource/jax.js b/unpacked/jax/output/PlainSource/jax.js @@ -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