Skip to content

Commit

Permalink
Don't call setRenderer if renderer is already SVG
Browse files Browse the repository at this point in the history
  • Loading branch information
jonmmease committed Sep 12, 2018
1 parent 1dd4fd3 commit 9569648
Showing 1 changed file with 7 additions and 2 deletions.
9 changes: 7 additions & 2 deletions src/lib/svg_text_utils.js
Original file line number Diff line number Diff line change
Expand Up @@ -174,10 +174,13 @@ function texToSVG(_texString, _config, _callback) {
MathJax.Hub.Queue(function() {
// Get original renderer
originalRenderer = MathJax.Hub.config.menuSettings.renderer;
if(originalRenderer !== 'SVG') {
return MathJax.Hub.setRenderer('SVG');
}
},
['setRenderer', MathJax.Hub, 'SVG'],
['Typeset', MathJax.Hub, tmpDiv.node()],
function() {

var glyphDefs = d3.select('body').select('#MathJax_SVG_glyphs');

if(tmpDiv.select('.MathJax_SVG').empty() || !tmpDiv.select('svg').node()) {
Expand All @@ -191,7 +194,9 @@ function texToSVG(_texString, _config, _callback) {

tmpDiv.remove();

return MathJax.Hub.setRenderer(originalRenderer);
if(originalRenderer !== 'SVG') {
return MathJax.Hub.setRenderer(originalRenderer);
}
});
}

Expand Down

0 comments on commit 9569648

Please sign in to comment.