commit 8726bd52a55e08f2b9e1dd504f4417d442b29720
parent b41981b3b3a9dbb61031de8aaf85d8d4e2d2b0a5
Author: Davide P. Cervone <dpvc@union.edu>
Date: Mon, 18 Aug 2014 10:01:01 -0400
Merge branch 'DOMfilterHooks' into develop
Diffstat:
1 file changed, 9 insertions(+), 6 deletions(-)
diff --git a/unpacked/jax/input/MathML/jax.js b/unpacked/jax/input/MathML/jax.js
@@ -36,12 +36,12 @@
MATHML.Parse = MathJax.Object.Subclass({
- Init: function (string) {this.Parse(string)},
+ Init: function (string,script) {this.Parse(string,script)},
//
// Parse the MathML and check for errors
//
- Parse: function (math) {
+ Parse: function (math,script) {
var doc;
if (typeof math !== "string") {doc = math.parentNode} else {
doc = MATHML.ParseXML(this.preProcessMath.call(this,math));
@@ -63,7 +63,9 @@
"MathML must be formed by a <math> element, not %1",
"<"+doc.firstChild.nodeName+">"]);
}
- this.mml = this.MakeMML(doc.firstChild);
+ var data = {math:doc.firstChild, script:script};
+ MATHML.DOMfilterHooks.Execute(data);
+ this.mml = this.MakeMML(data.math);
},
//
@@ -242,8 +244,9 @@
MATHML.Augment({
sourceMenuTitle: /*_(MathMenu)*/ ["OriginalMathML","Original MathML"],
- prefilterHooks: MathJax.Callback.Hooks(true), // hooks to run before processing MathML
- postfilterHooks: MathJax.Callback.Hooks(true), // hooks to run after processing MathML
+ prefilterHooks: MathJax.Callback.Hooks(true), // hooks to run on MathML string before processing MathML
+ DOMfilterHooks: MathJax.Callback.Hooks(true), // hooks to run on MathML DOM before processing
+ postfilterHooks: MathJax.Callback.Hooks(true), // hooks to run on internal jax format after processing MathML
Translate: function (script) {
if (!this.ParseXML) {this.ParseXML = this.createParser()}
@@ -258,7 +261,7 @@
data.math = math; this.prefilterHooks.Execute(data); math = data.math;
}
try {
- mml = MATHML.Parse(math).mml;
+ mml = MATHML.Parse(math,script).mml;
} catch(err) {
if (!err.mathmlError) {throw err}
mml = this.formatError(err,math,script);