Fix determination of line-breaing parent element. Resolves issue #1548.

This commit is contained in:
Davide P. Cervone 2016-07-04 13:16:06 -04:00
parent 7523687f4c
commit 86165f9a3a
3 changed files with 4 additions and 3 deletions

View File

@ -68,7 +68,7 @@ MathJax.Hub.Register.StartupHook("CommonHTML Jax Ready",function () {
//
var parent = this;
while (parent.inferred || (parent.parent && parent.parent.type === "mrow" &&
parent.parent.data.length === 1)) {parent = parent.parent}
parent.parent.isEmbellished())) {parent = parent.parent}
var isTop = ((parent.type === "math" && parent.Get("display") === "block") ||
parent.type === "mtd");
parent.isMultiline = true;
@ -234,6 +234,7 @@ MathJax.Hub.Register.StartupHook("CommonHTML Jax Ready",function () {
else align = prev.indentalign || def.indentalign;
if (align === MML.INDENTALIGN.INDENTALIGN) align = prev.indentalign || def.indentalign;
if (align === MML.INDENTALIGN.AUTO) align = (state.isTop ? CONFIG.displayAlign : MML.INDENTALIGN.LEFT);
console.log(align,state.isTop);
return align;
},
CHTMLgetShift: function (state,values,align,noadjust) {

View File

@ -67,7 +67,7 @@ MathJax.Hub.Register.StartupHook("HTML-CSS Jax Ready",function () {
//
var parent = this;
while (parent.inferred || (parent.parent && parent.parent.type === "mrow" &&
parent.parent.data.length === 1)) {parent = parent.parent}
parent.isEmbellished())) {parent = parent.parent}
var isTop = ((parent.type === "math" && parent.Get("display") === "block") ||
parent.type === "mtd");
parent.isMultiline = true;

View File

@ -65,7 +65,7 @@ MathJax.Hub.Register.StartupHook("SVG Jax Ready",function () {
//
var parent = this;
while (parent.inferred || (parent.parent && parent.parent.type === "mrow" &&
parent.parent.data.length === 1)) {parent = parent.parent}
parent.isEmbellished())) {parent = parent.parent}
var isTop = ((parent.type === "math" && parent.Get("display") === "block") ||
parent.type === "mtd");
parent.isMultiline = true;