Skip to content

Commit 1dd51fd

Browse files
committed
do not try to handle non-svg mathjax for now
1 parent 502c3e8 commit 1dd51fd

File tree

1 file changed

+2
-20
lines changed

1 file changed

+2
-20
lines changed

src/lib/svg_text_utils.js

Lines changed: 2 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -71,11 +71,7 @@ exports.convertToTspans = function(_context, gd, _callback) {
7171
parent.selectAll('svg.' + svgClass).remove();
7272
parent.selectAll('g.' + svgClass + '-group').remove();
7373

74-
var newSvg = _svgEl && _svgEl.select(
75-
v3Chtml() ?
76-
'mjx-math' :
77-
'svg'
78-
);
74+
var newSvg = _svgEl && _svgEl.select('svg');
7975
if(!newSvg || !newSvg.node()) {
8076
showText();
8177
resolve();
@@ -169,15 +165,6 @@ exports.convertToTspans = function(_context, gd, _callback) {
169165

170166
// MathJax
171167

172-
function v3Chtml() {
173-
return (
174-
MathJax &&
175-
MathJax.config &&
176-
MathJax.config.startup &&
177-
MathJax.config.startup.output === 'chtml'
178-
);
179-
}
180-
181168
var LT_MATCH = /(<|&lt;|&#60;)/g;
182169
var GT_MATCH = /(>|&gt;|&#62;)/g;
183170

@@ -249,12 +236,7 @@ function texToSVG(_texString, _config, _callback) {
249236
MathJaxVersion < 3 ? '.MathJax_SVG' : '.MathJax'
250237
);
251238

252-
var node = !sel.empty() && (
253-
v3Chtml() ?
254-
tmpDiv.select('mjx-math').node() : // TODO: handle non-svg element in texToSVG callback!
255-
tmpDiv.select('svg').node()
256-
);
257-
239+
var node = !sel.empty() && tmpDiv.select('svg').node();
258240
if(!node) {
259241
Lib.log('There was an error in the tex syntax.', _texString);
260242
_callback();

0 commit comments

Comments
 (0)