commit 9394d3257179cb36085cd1dda23face8e225a142
parent 609d6ca8fc9603da15eae2db259b5e82b3ffb931
Author: Davide P. Cervone <dpvc@union.edu>
Date: Tue, 30 Apr 2013 15:24:59 -0400
Handle empty child nodes better.
Diffstat:
2 files changed, 8 insertions(+), 7 deletions(-)
diff --git a/unpacked/jax/element/mml/jax.js b/unpacked/jax/element/mml/jax.js
@@ -397,10 +397,12 @@ MathJax.ElementJax.mml.Augment({
},
setBaseTeXclasses: function (prev) {
this.getPrevClass(prev); this.texClass = null;
- if (this.isEmbellished() || this.data[0].isa(MML.mi)) {
- prev = this.data[0].setTeXclass(prev);
- this.updateTeXclass(this.Core());
- } else {if (this.data[0]) {this.data[0].setTeXclass()}; prev = this}
+ if (this.data[0]) {
+ if (this.isEmbellished() || this.data[0].isa(MML.mi)) {
+ prev = this.data[0].setTeXclass(prev);
+ 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++)
{if (this.data[i]) {this.data[i].setTeXclass()}}
return prev;
diff --git a/unpacked/jax/output/HTML-CSS/jax.js b/unpacked/jax/output/HTML-CSS/jax.js
@@ -1674,9 +1674,8 @@
else {box.bbox = this.HTMLzeroBBox()}
},
HTMLboxChild: function (n,box) {
- if (this.data[n]) {return this.data[n].toHTML(box)}
- if (!box.bbox) {box.bbox = this.HTMLzeroBBox()}
- return null;
+ if (!this.data[n]) {this.SetData(n,MML.mrow())}
+ return this.data[n].toHTML(box);
},
HTMLcreateSpan: function (span) {