More checks to make sure nesting level doesn't go below zero. Issue #523.
This commit is contained in:
parent
cd0b88e524
commit
08ec41cd86
|
@ -160,13 +160,18 @@ MathJax.Hub.Register.StartupHook("HTML-CSS Jax Ready",function () {
|
|||
if (this.data[i]) {
|
||||
if (this.data[i].HTMLbetterBreak(info,state)) {
|
||||
better = true; index = [i].concat(info.index); W = info.W; w = info.w;
|
||||
if (info.penalty === PENALTY.newline) {info.index = index; info.nest--; return true}
|
||||
if (info.penalty === PENALTY.newline) {
|
||||
info.index = index;
|
||||
if (info.nest) {info.nest--}
|
||||
return true;
|
||||
}
|
||||
}
|
||||
scanW = (broken ? info.scanW : this.HTMLaddWidth(i,info,scanW));
|
||||
}
|
||||
info.index = []; i++; broken = false;
|
||||
}
|
||||
info.nest--; info.index = index;
|
||||
if (info.nest) {info.nest--}
|
||||
info.index = index;
|
||||
if (better) {info.W = W; info.w = w}
|
||||
return better;
|
||||
},
|
||||
|
@ -407,13 +412,17 @@ MathJax.Hub.Register.StartupHook("HTML-CSS Jax Ready",function () {
|
|||
if (this.data[k]) {
|
||||
if (this.data[k].HTMLbetterBreak(info,state)) {
|
||||
better = true; index = [i].concat(info.index); W = info.W; w = info.w;
|
||||
if (info.penalty === PENALTY.newline) {info.index = index; info.nest--; return true}
|
||||
if (info.penalty === PENALTY.newline) {
|
||||
info.index = index;
|
||||
if (info.nest) {info.nest--}
|
||||
return true}
|
||||
}
|
||||
scanW = (broken ? info.scanW : this.HTMLaddWidth(i,info,scanW));
|
||||
}
|
||||
info.index = []; i++; broken = false;
|
||||
}
|
||||
info.nest--; info.index = index;
|
||||
if (info.nest) {info.nest--}
|
||||
info.index = index;
|
||||
if (better) {info.W = W; info.w = w}
|
||||
return better;
|
||||
},
|
||||
|
|
|
@ -163,13 +163,18 @@ MathJax.Hub.Register.StartupHook("SVG Jax Ready",function () {
|
|||
if (this.data[i]) {
|
||||
if (this.data[i].SVGbetterBreak(info,state)) {
|
||||
better = true; index = [i].concat(info.index); W = info.W; w = info.w;
|
||||
if (info.penalty === PENALTY.newline) {info.index = index; info.nest--; return true}
|
||||
if (info.penalty === PENALTY.newline) {
|
||||
info.index = index;
|
||||
if (info.nest) {info.nest--}
|
||||
return true;
|
||||
}
|
||||
}
|
||||
scanW = (broken ? info.scanW : this.SVGaddWidth(i,info,scanW));
|
||||
}
|
||||
info.index = []; i++; broken = false;
|
||||
}
|
||||
info.nest--; info.index = index;
|
||||
if (info.nest) {info.nest--}
|
||||
info.index = index;
|
||||
if (better) {info.W = W}
|
||||
return better;
|
||||
},
|
||||
|
@ -365,13 +370,18 @@ MathJax.Hub.Register.StartupHook("SVG Jax Ready",function () {
|
|||
if (this.data[k]) {
|
||||
if (this.data[k].SVGbetterBreak(info,state)) {
|
||||
better = true; index = [i].concat(info.index); W = info.W; w = info.w;
|
||||
if (info.penalty === PENALTY.newline) {info.index = index; info.nest--; return true}
|
||||
if (info.penalty === PENALTY.newline) {
|
||||
info.index = index;
|
||||
if (info.nest) {info.nest--}
|
||||
return true;
|
||||
}
|
||||
}
|
||||
scanW = (broken ? info.scanW : this.SVGaddWidth(i,info,scanW));
|
||||
}
|
||||
info.index = []; i++; broken = false;
|
||||
}
|
||||
info.nest--; info.index = index;
|
||||
if (info.nest) {info.nest--}
|
||||
info.index = index;
|
||||
if (better) {info.W = W; info.w = w}
|
||||
return better;
|
||||
},
|
||||
|
|
Loading…
Reference in New Issue
Block a user