www

Unnamed repository; edit this file 'description' to name the repository.
Log | Files | Refs | README | LICENSE

commit 08ec41cd86c48ab3616cbdfd2f709e8d78dc48ff
parent cd0b88e524037a7bb539eda0330d2c21514b55f1
Author: Davide P. Cervone <dpvc@union.edu>
Date:   Mon, 28 Oct 2013 18:45:21 -0400

More checks to make sure nesting level doesn't go below zero.  Issue #523.

Diffstat:
Munpacked/jax/output/HTML-CSS/autoload/multiline.js | 17+++++++++++++----
Munpacked/jax/output/SVG/autoload/multiline.js | 18++++++++++++++----
2 files changed, 27 insertions(+), 8 deletions(-)

diff --git a/unpacked/jax/output/HTML-CSS/autoload/multiline.js b/unpacked/jax/output/HTML-CSS/autoload/multiline.js @@ -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; }, diff --git a/unpacked/jax/output/SVG/autoload/multiline.js b/unpacked/jax/output/SVG/autoload/multiline.js @@ -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; },