@@ -219,7 +219,8 @@ MathJax.Hub.Register.StartupHook("SVG Jax Ready",function () {
219
219
//
220
220
// Save the values needed for the future
221
221
//
222
- state . d = line . d ; state . values = values ; state . n ++ ;
222
+ state . d = line . d - ( line . y || 0 ) ;
223
+ state . values = values ; state . n ++ ;
223
224
} ,
224
225
225
226
/****************************************************************/
@@ -433,7 +434,7 @@ MathJax.Hub.Register.StartupHook("SVG Jax Ready",function () {
433
434
//
434
435
if ( ! broken ) { this . SVGaddWidth ( this . base , info , scanW ) }
435
436
info . scanW += this . SVGdata . dw ; info . W = info . scanW ;
436
- info . index = index ; if ( better ) { info . W = W ; info . w = w }
437
+ info . index = [ ] ; if ( better ) { info . W = W ; info . w = w ; info . index = index }
437
438
return better ;
438
439
} ,
439
440
@@ -455,9 +456,9 @@ MathJax.Hub.Register.StartupHook("SVG Jax Ready",function () {
455
456
// base that has been removed. Remove the empty base box from the stack.
456
457
//
457
458
if ( end . length === 0 ) {
458
- var sup = this . data [ this . sup ] , sub = this . data [ this . sub ] , w = svg . w ;
459
- if ( sup ) { svg . Add ( sup . toSVG ( ) , w + ( sup . SVGdata . dx || 0 ) , sup . SVGdata . dy ) }
460
- if ( sub ) { svg . Add ( sub . toSVG ( ) , w + ( sub . SVGdata . dx || 0 ) , sub . SVGdata . dy ) }
459
+ var sup = this . data [ this . sup ] , sub = this . data [ this . sub ] , w = svg . w , data ;
460
+ if ( sup ) { data = sup . SVGdata ; svg . Add ( sup . toSVG ( ) , w + ( data . dx || 0 ) , data . dy ) }
461
+ if ( sub ) { data = sub . SVGdata ; svg . Add ( sub . toSVG ( ) , w + ( data . dx || 0 ) , data . dy ) }
461
462
}
462
463
}
463
464
@@ -470,6 +471,7 @@ MathJax.Hub.Register.StartupHook("SVG Jax Ready",function () {
470
471
// Override the method for checking line breaks to properly handle <mo>
471
472
//
472
473
SVGbetterBreak : function ( info , state ) {
474
+ if ( info . values && info . values . last === this ) { return false }
473
475
var values = this . getValues (
474
476
"linebreak" , "linebreakstyle" , "lineleading" , "linebreakmultchar" ,
475
477
"indentalign" , "indentshift" ,
@@ -524,6 +526,7 @@ MathJax.Hub.Register.StartupHook("SVG Jax Ready",function () {
524
526
if ( penalty >= info . penalty ) { return false }
525
527
info . penalty = penalty ; info . values = values ; info . W = W ; info . w = w ;
526
528
values . lineleading = SVG . length2em ( values . lineleading , state . VALUES . lineleading ) ;
529
+ values . last = this ;
527
530
return true ;
528
531
}
529
532
} ) ;
@@ -535,6 +538,7 @@ MathJax.Hub.Register.StartupHook("SVG Jax Ready",function () {
535
538
// Override the method for checking line breaks to properly handle <mspace>
536
539
//
537
540
SVGbetterBreak : function ( info , state ) {
541
+ if ( info . values && info . values . last === this ) { return false }
538
542
var values = this . getValues ( "linebreak" ) ;
539
543
//
540
544
// Get the default penalty for this location
@@ -563,7 +567,8 @@ MathJax.Hub.Register.StartupHook("SVG Jax Ready",function () {
563
567
//
564
568
if ( penalty >= info . penalty ) { return false }
565
569
info . penalty = penalty ; info . values = values ; info . W = W ; info . w = w ;
566
- values . lineleading = state . VALUES . lineleading ; values . linebreakstyle = "before" ;
570
+ values . lineleading = state . VALUES . lineleading ;
571
+ values . linebreakstyle = "before" ; values . last = this ;
567
572
return true ;
568
573
}
569
574
} ) ;
@@ -592,24 +597,6 @@ MathJax.Hub.Register.StartupHook("SVG Jax Ready",function () {
592
597
SVGmoveLine : function ( start , end , svg , state , values ) {
593
598
return this . Core ( ) . SVGmoveSlice ( start , end , svg , state , values ) ;
594
599
} ,
595
- /*
596
- * //
597
- * // Split and move the hit boxes as well
598
- * //
599
- * SVGmoveSlice: function (start,end,svg,state,values,padding) {
600
- * var hitbox = document.getElementById("MathJax-HitBox-"+this.spanID+SVG.idPostfix);
601
- * if (hitbox) {hitbox.parentNode.removeChild(hitbox)}
602
- * var slice = this.SUPER(arguments).SVGmoveSlice.apply(this,arguments);
603
- * if (end.length === 0) {
604
- * span = this.SVGspanElement(); var n = 0;
605
- * while (span) {
606
- * hitbox = this.SVGhandleHitBox(span,"-Continue-"+n);
607
- * span = span.nextMathJaxSpan; n++;
608
- * }
609
- * }
610
- * return slice;
611
- * }
612
- */
613
600
} ) ;
614
601
615
602
//
0 commit comments