Skip to content

Commit 1dd4fd3

Browse files
committed
Call final MathJax.Hub.setRenderer directly (not with Queue)
This should remove a potential race condition
1 parent 951523d commit 1dd4fd3

File tree

1 file changed

+2
-5
lines changed

1 file changed

+2
-5
lines changed

Diff for: src/lib/svg_text_utils.js

+2-5
Original file line numberDiff line numberDiff line change
@@ -178,11 +178,6 @@ function texToSVG(_texString, _config, _callback) {
178178
['setRenderer', MathJax.Hub, 'SVG'],
179179
['Typeset', MathJax.Hub, tmpDiv.node()],
180180
function() {
181-
// Restore original renderer if not SVG
182-
if(originalRenderer !== 'SVG') {
183-
MathJax.Hub.Queue(['setRenderer', MathJax.Hub, originalRenderer]);
184-
}
185-
186181
var glyphDefs = d3.select('body').select('#MathJax_SVG_glyphs');
187182

188183
if(tmpDiv.select('.MathJax_SVG').empty() || !tmpDiv.select('svg').node()) {
@@ -195,6 +190,8 @@ function texToSVG(_texString, _config, _callback) {
195190
}
196191

197192
tmpDiv.remove();
193+
194+
return MathJax.Hub.setRenderer(originalRenderer);
198195
});
199196
}
200197

0 commit comments

Comments
 (0)