Skip to content

Commit 470d97c

Browse files
committed
Fix toCommonHTML() so stretch is passed as an option (prevents math processing error in fractions with line breaks)
1 parent ce6b729 commit 470d97c

File tree

1 file changed

+14
-13
lines changed
  • unpacked/jax/output/CommonHTML

1 file changed

+14
-13
lines changed

unpacked/jax/output/CommonHTML/jax.js

Lines changed: 14 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -1706,12 +1706,12 @@
17061706
//
17071707
CHTMLstretchV: function (h,d) {
17081708
this.Core().CHTMLstretchV(h,d);
1709-
this.toCommonHTML(this.CHTMLnodeElement(),true);
1709+
this.toCommonHTML(this.CHTMLnodeElement(),{stretch:true});
17101710
return this.CHTML;
17111711
},
17121712
CHTMLstretchH: function (node,w) {
17131713
this.CHTMLstretchCoreH(node,w);
1714-
this.toCommonHTML(node,true);
1714+
this.toCommonHTML(node,{stretch:true});
17151715
return this.CHTML;
17161716
}
17171717
});
@@ -2044,9 +2044,9 @@
20442044
/********************************************************/
20452045

20462046
MML.mpadded.Augment({
2047-
toCommonHTML: function (node,stretch) {
2047+
toCommonHTML: function (node,options) {
20482048
var child;
2049-
if (stretch) {
2049+
if (options && options.stretch) {
20502050
node = node.firstChild; child = node.firstChild;
20512051
} else {
20522052
node = this.CHTMLdefaultNode(node,{childNodes:"mjx-box", forceChild:true});
@@ -2101,7 +2101,7 @@
21012101
/********************************************************/
21022102

21032103
MML.munderover.Augment({
2104-
toCommonHTML: function (node,stretch) {
2104+
toCommonHTML: function (node,options) {
21052105
var values = this.getValues("displaystyle","accent","accentunder","align");
21062106
var base = this.data[this.base];
21072107
if (!values.displaystyle && base != null &&
@@ -2110,12 +2110,13 @@
21102110
//
21112111
// Get the nodes for base and limits
21122112
//
2113-
var under, over, nodes = [];
2114-
if (stretch) {
2113+
var under, over, nodes = [], stretch = false;
2114+
if (options && options.stretch) {
21152115
if (this.data[this.base]) base = CHTML.getNode(node,"mjx-op");
21162116
if (this.data[this.under]) under = CHTML.getNode(node,"mjx-under");
21172117
if (this.data[this.over]) over = CHTML.getNode(node,"mjx-over");
21182118
nodes[0] = base; nodes[1] = under||over; nodes[2] = over;
2119+
stretch = true;
21192120
} else {
21202121
var types = ["mjx-op","mjx-under","mjx-over"];
21212122
if (this.over === 1) types[1] = types[2];
@@ -2309,15 +2310,15 @@
23092310
/********************************************************/
23102311

23112312
MML.msubsup.Augment({
2312-
toCommonHTML: function (node,stretch) {
2313+
toCommonHTML: function (node,options) {
23132314
var values = this.getValues(
23142315
"displaystyle","subscriptshift","superscriptshift","texprimestyle"
23152316
);
23162317
//
23172318
// Get the nodes for base and limits
23182319
//
23192320
var base, sub, sup;
2320-
if (stretch) {
2321+
if (options && options.stretch) {
23212322
if (this.data[this.base]) base = CHTML.getNode(node,"mjx-base");
23222323
if (this.data[this.sub]) sub = CHTML.getNode(node,"mjx-sub");
23232324
if (this.data[this.sup]) sup = CHTML.getNode(node,"mjx-sup");
@@ -2655,8 +2656,8 @@
26552656
/********************************************************/
26562657

26572658
MML.TeXAtom.Augment({
2658-
toCommonHTML: function (node,stretch) {
2659-
if (!stretch) node = this.CHTMLdefaultNode(node);
2659+
toCommonHTML: function (node,options) {
2660+
if (!options || !options.stretch) node = this.CHTMLdefaultNode(node);
26602661
if (this.texClass === MML.TEXCLASS.VCENTER) {
26612662
var a = CHTML.TEX.axis_height, BBOX = this.CHTML;
26622663
var v = a-(BBOX.h+BBOX.d)/2+BBOX.d;
@@ -2669,12 +2670,12 @@
26692670
},
26702671
CHTMLstretchV: function (h,d) {
26712672
this.CHTML.updateFrom(this.Core().CHTMLstretchV(h,d));
2672-
this.toCommonHTML(this.CHTMLnodeElement(),true);
2673+
this.toCommonHTML(this.CHTMLnodeElement(),{stretch:true});
26732674
return this.CHTML;
26742675
},
26752676
CHTMLstretchH: function (node,w) {
26762677
this.CHTML.updateFrom(this.CHTMLstretchCoreH(node,w));
2677-
this.toCommonHTML(node,true);
2678+
this.toCommonHTML(node,{stretch:true});
26782679
return this.CHTML;
26792680
}
26802681
});

0 commit comments

Comments
 (0)