|
96 | 96 | return this.postFilter(preview,data);
|
97 | 97 | },
|
98 | 98 | 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({})); |
115 | 109 | }
|
| 110 | + data.math.root.toCommonHTML(preview); |
116 | 111 | },
|
117 | 112 |
|
118 | 113 | //
|
|
135 | 130 | CHTMLpreview.Register("AsciiMath");
|
136 | 131 |
|
137 | 132 | HUB.Register.StartupHook("End Config",["Config",CHTMLpreview]);
|
| 133 | + |
| 134 | + HUB.Startup.signal.Post("CHTML-preview Ready"); |
138 | 135 |
|
139 | 136 | })(MathJax.Hub,MathJax.HTML);
|
140 | 137 |
|
|
0 commit comments