File tree Expand file tree Collapse file tree 6 files changed +11
-11
lines changed Expand file tree Collapse file tree 6 files changed +11
-11
lines changed Original file line number Diff line number Diff line change @@ -2182,7 +2182,7 @@ MathJax.Hub = {
2182
2182
//
2183
2183
// Check if already processed or needs processing
2184
2184
//
2185
- if ( ! script . MathJax || script . MathJax . state === STATE . PROCESSED ) { state . i ++ ; continue } ;
2185
+ if ( ! script . parentNode || ! script . MathJax || script . MathJax . state === STATE . PROCESSED ) { state . i ++ ; continue } ;
2186
2186
if ( ! script . MathJax . elementJax || script . MathJax . state === STATE . UPDATE ) {
2187
2187
this . checkScriptSiblings ( script ) ; // remove preJax/postJax etc.
2188
2188
var type = script . type . replace ( / * ; ( .| \s ) * / , "" ) ; // the input jax type
@@ -2286,7 +2286,7 @@ MathJax.Hub = {
2286
2286
// Check that there is an element jax
2287
2287
//
2288
2288
script = state . scripts [ state . i ] ;
2289
- if ( ! script || ! script . MathJax || script . MathJax . error ) { state . i ++ ; continue }
2289
+ if ( ! script || ! script . parentNode || ! script . MathJax || script . MathJax . error ) { state . i ++ ; continue }
2290
2290
var jax = script . MathJax . elementJax ; if ( ! jax ) { state . i ++ ; continue }
2291
2291
//
2292
2292
// Call the output Jax's Process method (which will be its Translate()
Original file line number Diff line number Diff line change 100
100
// and call the PreviewHTML output jax to create the preview
101
101
//
102
102
Preview : function ( data ) {
103
- if ( ! this . Active ( ) ) return ;
103
+ if ( ! this . Active ( ) || ! data . script . parentNode ) return ;
104
104
var preview = data . script . MathJax . preview || data . script . previousSibling ;
105
105
if ( ! preview || preview . className !== MathJax . Hub . config . preRemoveClass ) {
106
106
preview = HTML . Element ( "span" , { className :MathJax . Hub . config . preRemoveClass } ) ;
Original file line number Diff line number Diff line change 745
745
//
746
746
for ( i = state . HTMLCSSlast , m = state . HTMLCSSeqn ; i < m ; i ++ ) {
747
747
script = scripts [ i ] ;
748
- if ( script && script . MathJax . elementJax ) {
749
- var div = script . MathJax . elementJax . HTMLCSS . div ;
750
- div . className = div . className . split ( / / ) [ 0 ] ;
748
+ if ( script && script . parentNode && script . MathJax . elementJax ) {
749
+ var div = ( script . MathJax . elementJax . HTMLCSS || { } ) . div ;
750
+ if ( div ) { div . className = div . className . split ( / / ) [ 0 ] }
751
751
if ( script . MathJax . preview ) { script . MathJax . preview . innerHTML = "" }
752
752
}
753
753
}
756
756
//
757
757
for ( i = state . HTMLCSSlast , m = state . HTMLCSSeqn ; i < m ; i ++ ) {
758
758
script = scripts [ i ] ;
759
- if ( script && script . MathJax . elementJax ) {
759
+ if ( script && script . parentNode && script . MathJax . elementJax ) {
760
760
jax = script . MathJax . elementJax ; this . getMetrics ( jax ) ;
761
761
jax . root . toHTML ( jax . HTMLCSS . span , jax . HTMLCSS . div , this . PHASE . II ) ;
762
762
}
766
766
//
767
767
for ( i = state . HTMLCSSlast , m = state . HTMLCSSeqn ; i < m ; i ++ ) {
768
768
script = scripts [ i ] ;
769
- if ( script && script . MathJax . elementJax ) {
769
+ if ( script && script . parentNode && script . MathJax . elementJax ) {
770
770
//
771
771
// Finish the math with its measured size (toHTML phase III)
772
772
//
Original file line number Diff line number Diff line change 65
65
// Remove any existing output
66
66
//
67
67
prev = script . previousSibling ;
68
- if ( prev && String ( prev . className ) . match ( / ^ M a t h J a x _ P l a i n S o u r c e ( _ D i s p l a y ) ? ( M a t h J a x _ P r o c e s s i n g ) ? $ / ) ) {
68
+ if ( prev && String ( prev . className ) . match ( / ^ M a t h J a x ( _ P l a i n S o u r c e ) ? ( _ D i s p l a y ) ? ( M a t h J a x _ P r o c e s s ( i n g | e d ) ) ? $ / ) ) {
69
69
prev . parentNode . removeChild ( prev ) ;
70
70
}
71
71
//
Original file line number Diff line number Diff line change 185
185
// Remove any existing output
186
186
//
187
187
prev = script . previousSibling ;
188
- if ( prev && String ( prev . className ) . match ( / ^ M a t h J a x _ P H T M L ( _ D i s p l a y ) ? ( M a t h J a x _ P r o c e s s i n g ) ? $ / ) )
188
+ if ( prev && String ( prev . className ) . match ( / ^ M a t h J a x ( _ P H T M L ) ? ( _ D i s p l a y ) ? ( M a t h J a x _ P r o c e s s ( i n g | e d ) ) ? $ / ) )
189
189
{ prev . parentNode . removeChild ( prev ) }
190
190
//
191
191
// Add the span, and a div if in display mode,
Original file line number Diff line number Diff line change 207
207
// Remove any existing output
208
208
//
209
209
prev = script . previousSibling ;
210
- if ( prev && String ( prev . className ) . match ( / ^ M a t h J a x ( _ S V G ) ? ( _ D i s p l a y ) ? ( M a t h J a x ( _ S V G ) ? _ P r o c e s s i n g ) ? $ / ) )
210
+ if ( prev && String ( prev . className ) . match ( / ^ M a t h J a x ( _ S V G ) ? ( _ D i s p l a y ) ? ( M a t h J a x ( _ S V G ) ? _ P r o c e s s ( i n g | e d ) ) ? $ / ) )
211
211
{ prev . parentNode . removeChild ( prev ) }
212
212
//
213
213
// Add the span, and a div if in display mode,
You can’t perform that action at this time.
0 commit comments