Merge branch 'issue1018' into develop. Issue #1018.

This commit is contained in:
Davide P. Cervone 2015-01-24 13:38:00 -05:00
commit f6b374813f

View File

@ -96,23 +96,18 @@
return this.postFilter(preview,data);
},
postFilter: function (preview,data) {
try {
data.math.root.toCommonHTML(preview);
} catch (err) {
//
// Load the CommonHTML jax if it is not already loaded
//
if (!data.math.root.toCommonHTML) {
var queue = MathJax.Callback.Queue();
queue.Push(
["Require",MathJax.Ajax,"[MathJax]/jax/output/CommonHTML/config.js"],
["Require",MathJax.Ajax,"[MathJax]/jax/output/CommonHTML/jax.js"]
);
HUB.RestartAfter(queue.Push({}));
}
if (!err.restart) {throw err} // an actual error
return MathJax.Callback.After(["postFilter",this,preview,data],err.restart);
//
// Load the CommonHTML jax if it is not already loaded
//
if (!data.math.root.toCommonHTML) {
var queue = MathJax.Callback.Queue();
queue.Push(
["Require",MathJax.Ajax,"[MathJax]/jax/output/CommonHTML/config.js"],
["Require",MathJax.Ajax,"[MathJax]/jax/output/CommonHTML/jax.js"]
);
HUB.RestartAfter(queue.Push({}));
}
data.math.root.toCommonHTML(preview);
},
//
@ -136,6 +131,8 @@
HUB.Register.StartupHook("End Config",["Config",CHTMLpreview]);
HUB.Startup.signal.Post("CHTML-preview Ready");
})(MathJax.Hub,MathJax.HTML);
MathJax.Ajax.loadComplete("[MathJax]/extensions/CHTML-preview.js");