Skip to content

Commit 63e240e

Browse files
committed
fixup defs selection in v3
1 parent ec0e0d3 commit 63e240e

File tree

1 file changed

+6
-3
lines changed

1 file changed

+6
-3
lines changed

src/lib/svg_text_utils.js

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -259,9 +259,12 @@ function texToSVG(_texString, _config, _callback) {
259259
_callback();
260260
} else {
261261
var nodeBBox = node.getBoundingClientRect();
262-
var glyphDefs = d3.select('body').select(
263-
MathJaxVersion < 3 ? '#MathJax_SVG_glyphs' : 'defs'
264-
);
262+
var glyphDefs;
263+
if(MathJaxVersion < 3) {
264+
glyphDefs = d3.select('body').select('#MathJax_SVG_glyphs');
265+
} else {
266+
glyphDefs = sel.select('defs');
267+
}
265268
_callback(sel, glyphDefs, nodeBBox);
266269
}
267270

0 commit comments

Comments
 (0)