commit efa443ce65eea523379d1f3d59f8681f8396c1d3
parent cd235d5b0e29d001db8f2463785920f3208dc7b7
Author: Davide P. Cervone <dpvc@union.edu>
Date: Fri, 23 Jan 2015 12:45:26 -0500
Check for toCommonHTML first, and allow errors to propagate (restarts should restart, not be trapped here). Resolves issue #1018.
Diffstat:
1 file changed, 13 insertions(+), 16 deletions(-)
diff --git a/unpacked/extensions/CHTML-preview.js b/unpacked/extensions/CHTML-preview.js
@@ -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);
},
//
@@ -135,6 +130,8 @@
CHTMLpreview.Register("AsciiMath");
HUB.Register.StartupHook("End Config",["Config",CHTMLpreview]);
+
+ HUB.Startup.signal.Post("CHTML-preview Ready");
})(MathJax.Hub,MathJax.HTML);