Handle empty child nodes better.

This commit is contained in:
Davide P. Cervone 2013-04-30 15:24:59 -04:00
parent 609d6ca8fc
commit 9394d32571
2 changed files with 8 additions and 7 deletions

View File

@ -397,10 +397,12 @@ MathJax.ElementJax.mml.Augment({
}, },
setBaseTeXclasses: function (prev) { setBaseTeXclasses: function (prev) {
this.getPrevClass(prev); this.texClass = null; this.getPrevClass(prev); this.texClass = null;
if (this.isEmbellished() || this.data[0].isa(MML.mi)) { if (this.data[0]) {
prev = this.data[0].setTeXclass(prev); if (this.isEmbellished() || this.data[0].isa(MML.mi)) {
this.updateTeXclass(this.Core()); prev = this.data[0].setTeXclass(prev);
} else {if (this.data[0]) {this.data[0].setTeXclass()}; prev = this} this.updateTeXclass(this.Core());
} else {this.data[0].setTeXclass(); prev = this}
} else {prev = this}
for (var i = 1, m = this.data.length; i < m; i++) for (var i = 1, m = this.data.length; i < m; i++)
{if (this.data[i]) {this.data[i].setTeXclass()}} {if (this.data[i]) {this.data[i].setTeXclass()}}
return prev; return prev;

View File

@ -1674,9 +1674,8 @@
else {box.bbox = this.HTMLzeroBBox()} else {box.bbox = this.HTMLzeroBBox()}
}, },
HTMLboxChild: function (n,box) { HTMLboxChild: function (n,box) {
if (this.data[n]) {return this.data[n].toHTML(box)} if (!this.data[n]) {this.SetData(n,MML.mrow())}
if (!box.bbox) {box.bbox = this.HTMLzeroBBox()} return this.data[n].toHTML(box);
return null;
}, },
HTMLcreateSpan: function (span) { HTMLcreateSpan: function (span) {