File tree Expand file tree Collapse file tree 1 file changed +10
-2
lines changed Expand file tree Collapse file tree 1 file changed +10
-2
lines changed Original file line number Diff line number Diff line change @@ -184,11 +184,14 @@ MathJax.Extension.mml2jax = {
184
184
createPreview : function ( math , script ) {
185
185
var preview = this . config . preview ;
186
186
if ( preview === "none" ) return ;
187
+ var isNodePreview = false ;
187
188
if ( preview === "mathml" ) {
189
+ isNodePreview = true ;
188
190
// mathml preview does not work with IE < 9, so fallback to alttext.
189
191
if ( this . MathTagBug ) { preview = "alttext" } else { preview = math }
190
192
}
191
193
if ( preview === "alttext" || preview === "altimg" ) {
194
+ isNodePreview = true ;
192
195
var alttext = this . filterPreview ( math . getAttribute ( "alttext" ) ) ;
193
196
if ( preview === "alttext" ) {
194
197
if ( alttext != null ) { preview = MathJax . HTML . TextNode ( alttext ) } else { preview = null }
@@ -202,8 +205,13 @@ MathJax.Extension.mml2jax = {
202
205
}
203
206
}
204
207
if ( preview ) {
205
- var span = MathJax . HTML . Element ( "span" , { className :MathJax . Hub . config . preRemoveClass } ) ;
206
- span . appendChild ( preview ) ;
208
+ var span ;
209
+ if ( isNodePreview ) {
210
+ span = MathJax . HTML . Element ( "span" , { className :MathJax . Hub . config . preRemoveClass } ) ;
211
+ span . appendChild ( preview ) ;
212
+ } else {
213
+ span = MathJax . HTML . Element ( "span" , { className :MathJax . Hub . config . preRemoveClass } , preview ) ;
214
+ }
207
215
script . parentNode . insertBefore ( span , script ) ;
208
216
}
209
217
} ,
You can’t perform that action at this time.
0 commit comments