From b2ce6ef0a0d70e3089037eb51fc3402321ca41de Mon Sep 17 00:00:00 2001 From: "Davide P. Cervone" Date: Sat, 17 May 2014 13:48:44 -0400 Subject: [PATCH] Make fallback parser clear itself after use, so there isn't an extra element left over at the end (typsetting again causes problems). --- unpacked/jax/input/MathML/jax.js | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/unpacked/jax/input/MathML/jax.js b/unpacked/jax/input/MathML/jax.js index 46515c6a0..74344e9cc 100644 --- a/unpacked/jax/input/MathML/jax.js +++ b/unpacked/jax/input/MathML/jax.js @@ -282,8 +282,11 @@ parseDOM: function (string) {return this.parser.parseFromString(string,"text/xml")}, parseMS: function (string) {return (this.parser.loadXML(string) ? this.parser : null)}, parseDIV: function (string) { - this.div.innerHTML = string.replace(/<([a-z]+)([^>]*)\/>/g,"<$1$2>"); - return this.div; + this.div.innerHTML = + "
"+string.replace(/<([a-z]+)([^>]*)\/>/g,"<$1$2>")+"
"; + var doc = this.div.firstChild; + this.div.innerHTML = ""; + return doc; }, parseError: function (string) {return null}, createMSParser: function() {