Skip to content

Commit 033bee3

Browse files
committed
short-circuit missing MathJax in convertToTspans
1 parent 801fb47 commit 033bee3

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

src/lib/svg_text_utils.js

+4-1
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,10 @@ exports.convertToTspans = function(_context, gd, _callback) {
3030

3131
// Until we get tex integrated more fully (so it can be used along with non-tex)
3232
// allow some elements to prohibit it by attaching 'data-notex' to the original
33-
var tex = (!_context.attr('data-notex')) && str.match(FIND_TEX);
33+
var tex = (!_context.attr('data-notex')) &&
34+
str.match(FIND_TEX) &&
35+
(typeof MathJax !== 'undefined');
36+
3437
var parent = d3.select(_context.node().parentNode);
3538
if(parent.empty()) return;
3639
var svgClass = (_context.attr('class')) ? _context.attr('class').split(' ')[0] : 'text';

0 commit comments

Comments
 (0)