Skip to content

Commit

Permalink
short-circuit missing MathJax in convertToTspans
Browse files Browse the repository at this point in the history
  • Loading branch information
alexcjohnson committed Jun 14, 2017
1 parent 801fb47 commit 033bee3
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion src/lib/svg_text_utils.js
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,10 @@ exports.convertToTspans = function(_context, gd, _callback) {

// Until we get tex integrated more fully (so it can be used along with non-tex)
// allow some elements to prohibit it by attaching 'data-notex' to the original
var tex = (!_context.attr('data-notex')) && str.match(FIND_TEX);
var tex = (!_context.attr('data-notex')) &&
str.match(FIND_TEX) &&
(typeof MathJax !== 'undefined');

var parent = d3.select(_context.node().parentNode);
if(parent.empty()) return;
var svgClass = (_context.attr('class')) ? _context.attr('class').split(' ')[0] : 'text';
Expand Down

0 comments on commit 033bee3

Please sign in to comment.