Skip to content

Commit

Permalink
Merge pull request #644 from dpvc/issue523
Browse files Browse the repository at this point in the history
Resolves issue #523
  • Loading branch information
dpvc committed Oct 30, 2013
2 parents 6448c0c + 08ec41c commit 1f013d7
Show file tree
Hide file tree
Showing 2 changed files with 29 additions and 10 deletions.
19 changes: 14 additions & 5 deletions unpacked/jax/output/HTML-CSS/autoload/multiline.js
Original file line number Diff line number Diff line change
Expand Up @@ -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;
},
Expand Down Expand Up @@ -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;
},
Expand Down Expand Up @@ -542,7 +551,7 @@ MathJax.Hub.Register.StartupHook("HTML-CSS Jax Ready",function () {
// mrows for nesting, but can leave these unbalanced.
//
if (values.texClass === MML.TEXCLASS.OPEN) {info.nest++}
if (values.texClass === MML.TEXCLASS.CLOSE) {info.nest--}
if (values.texClass === MML.TEXCLASS.CLOSE && info.nest) {info.nest--}
//
// Get the default penalty for this location
//
Expand Down
20 changes: 15 additions & 5 deletions unpacked/jax/output/SVG/autoload/multiline.js
Original file line number Diff line number Diff line change
Expand Up @@ -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;
},
Expand Down Expand Up @@ -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;
},
Expand Down Expand Up @@ -490,7 +500,7 @@ MathJax.Hub.Register.StartupHook("SVG Jax Ready",function () {
// mrows for nesting, but can leave these unbalanced.
//
if (values.texClass === MML.TEXCLASS.OPEN) {info.nest++}
if (values.texClass === MML.TEXCLASS.CLOSE) {info.nest--}
if (values.texClass === MML.TEXCLASS.CLOSE && info.nest) {info.nest--}
//
// Get the default penalty for this location
//
Expand Down

0 comments on commit 1f013d7

Please sign in to comment.