File tree Expand file tree Collapse file tree 1 file changed +4
-2
lines changed
unpacked/extensions/MathML Expand file tree Collapse file tree 1 file changed +4
-2
lines changed Original file line number Diff line number Diff line change @@ -1317,9 +1317,11 @@ MathJax.Extension["MathML/content-mathml"] = (function(HUB) {
1317
1317
} else if ( arg . nodeName === 'apply' && children . length === 2 && children [ 0 ] . nodeName === 'minus' ) {
1318
1318
CToP . appendToken ( mrow , 'mo' , '\u2212' ) ;
1319
1319
CToP . applyTransform ( mrow , children [ 1 ] , 2 ) ;
1320
- } else if ( arg . nodeName === 'apply' && children . length > 2 && children [ 0 ] . nodeName === 'times' && children [ 1 ] . nodeName === 'cn' && ( n = Number ( CToP . getTextContent ( children [ 1 ] ) ) < 0 ) ) {
1320
+ } else if ( arg . nodeName === 'apply' && children . length > 2 && children [ 0 ] . nodeName === 'times' && children [ 1 ] . nodeName === 'cn' && ( n = Number ( CToP . getTextContent ( children [ 1 ] ) ) ) < 0 ) {
1321
1321
CToP . appendToken ( mrow , 'mo' , '\u2212' ) ;
1322
- CToP . getTextContent ( children [ 1 ] ) = - n ; // fix me: modifying document
1322
+ arg = arg . cloneNode ( true ) ;
1323
+ children = CToP . getChildren ( arg ) ;
1324
+ children [ 1 ] . textContent = - n ;
1323
1325
CToP . applyTransform ( mrow , arg , 2 ) ;
1324
1326
} else {
1325
1327
CToP . appendToken ( mrow , 'mo' , '+' ) ;
You can’t perform that action at this time.
0 commit comments