@@ -19,7 +19,7 @@ exports.convertToTspans = function(_context, gd, _callback) {
19
19
// Until we get tex integrated more fully (so it can be used along with non-tex)
20
20
// allow some elements to prohibit it by attaching 'data-notex' to the original
21
21
var tex = ( ! _context . attr ( 'data-notex' ) ) &&
22
- gd . _context . typesetMath &&
22
+ gd && gd . _context . typesetMath &&
23
23
( typeof MathJax !== 'undefined' ) &&
24
24
str . match ( FIND_TEX ) ;
25
25
@@ -188,6 +188,7 @@ function texToSVG(_texString, _config, _callback) {
188
188
var originalRenderer ,
189
189
originalConfig ,
190
190
originalProcessSectionDelay ,
191
+ noOriginalInlineMath ,
191
192
tmpDiv ;
192
193
193
194
var setConfig = function ( ) {
@@ -212,6 +213,7 @@ function texToSVG(_texString, _config, _callback) {
212
213
213
214
if ( ! MathJax . config . tex . inlineMath ) {
214
215
MathJax . config . tex . inlineMath = inlineMath ;
216
+ noOriginalInlineMath = true ;
215
217
}
216
218
}
217
219
} ;
@@ -291,7 +293,11 @@ function texToSVG(_texString, _config, _callback) {
291
293
}
292
294
return MathJax . Hub . Config ( originalConfig ) ;
293
295
} else {
294
- MathJax . config . tex . inlineMath = originalConfig . tex . inlineMath ;
296
+ if ( noOriginalInlineMath ) {
297
+ delete MathJax . config . tex . inlineMath ;
298
+ } else {
299
+ MathJax . config . tex . inlineMath = originalConfig . tex . inlineMath ;
300
+ }
295
301
}
296
302
} ;
297
303
0 commit comments