Skip to content

Commit f6b3748

Browse files
committed
Merge branch 'issue1018' into develop. Issue #1018.
2 parents 20e1e01 + efa443c commit f6b3748

File tree

1 file changed

+13
-16
lines changed

1 file changed

+13
-16
lines changed

unpacked/extensions/CHTML-preview.js

Lines changed: 13 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -96,23 +96,18 @@
9696
return this.postFilter(preview,data);
9797
},
9898
postFilter: function (preview,data) {
99-
try {
100-
data.math.root.toCommonHTML(preview);
101-
} catch (err) {
102-
//
103-
// Load the CommonHTML jax if it is not already loaded
104-
//
105-
if (!data.math.root.toCommonHTML) {
106-
var queue = MathJax.Callback.Queue();
107-
queue.Push(
108-
["Require",MathJax.Ajax,"[MathJax]/jax/output/CommonHTML/config.js"],
109-
["Require",MathJax.Ajax,"[MathJax]/jax/output/CommonHTML/jax.js"]
110-
);
111-
HUB.RestartAfter(queue.Push({}));
112-
}
113-
if (!err.restart) {throw err} // an actual error
114-
return MathJax.Callback.After(["postFilter",this,preview,data],err.restart);
99+
//
100+
// Load the CommonHTML jax if it is not already loaded
101+
//
102+
if (!data.math.root.toCommonHTML) {
103+
var queue = MathJax.Callback.Queue();
104+
queue.Push(
105+
["Require",MathJax.Ajax,"[MathJax]/jax/output/CommonHTML/config.js"],
106+
["Require",MathJax.Ajax,"[MathJax]/jax/output/CommonHTML/jax.js"]
107+
);
108+
HUB.RestartAfter(queue.Push({}));
115109
}
110+
data.math.root.toCommonHTML(preview);
116111
},
117112

118113
//
@@ -135,6 +130,8 @@
135130
CHTMLpreview.Register("AsciiMath");
136131

137132
HUB.Register.StartupHook("End Config",["Config",CHTMLpreview]);
133+
134+
HUB.Startup.signal.Post("CHTML-preview Ready");
138135

139136
})(MathJax.Hub,MathJax.HTML);
140137

0 commit comments

Comments
 (0)