From 12f969593d9c885caaa1252ab53c32e27cda2c2d Mon Sep 17 00:00:00 2001 From: "Davide P. Cervone" Date: Fri, 21 Mar 2014 06:58:46 -0400 Subject: [PATCH] Remove initial space after a linebreak properly. Resolves #687. --- unpacked/jax/output/HTML-CSS/autoload/multiline.js | 4 ++-- unpacked/jax/output/SVG/autoload/multiline.js | 9 +++++---- 2 files changed, 7 insertions(+), 6 deletions(-) diff --git a/unpacked/jax/output/HTML-CSS/autoload/multiline.js b/unpacked/jax/output/HTML-CSS/autoload/multiline.js index 60916f630..09d90774a 100644 --- a/unpacked/jax/output/HTML-CSS/autoload/multiline.js +++ b/unpacked/jax/output/HTML-CSS/autoload/multiline.js @@ -366,15 +366,15 @@ MathJax.Hub.Register.StartupHook("HTML-CSS Jax Ready",function () { // if (state.last) {span.style.paddingRight = ""} if (state.first || state.nextIsFirst) { - delete state.nextIsFirst; span.style.paddingLeft = ""; if (color) {this.HTMLremoveColor(span); this.HTMLhandleColor(span)} } + if (state.first) {state.nextIsFirst = true} else {delete state.nextIsFirst} // // Update bounding box // this.HTMLcombineBBoxes(this,line.bbox); - } else if (state.first) {state.nextIsFirst = true} else {delete state.nextIsFirst} + } } }); diff --git a/unpacked/jax/output/SVG/autoload/multiline.js b/unpacked/jax/output/SVG/autoload/multiline.js index 7fb753e19..a5bd05eac 100644 --- a/unpacked/jax/output/SVG/autoload/multiline.js +++ b/unpacked/jax/output/SVG/autoload/multiline.js @@ -328,14 +328,15 @@ MathJax.Hub.Register.StartupHook("SVG Jax Ready",function () { (state.last && values.linebreakstyle === MML.LINEBREAKSTYLE.AFTER)) { // // Recreate output - // Remove padding (if first, remove at right, if last remove at left) + // Remove padding (if first, remove at leftt, if last remove at right) // Add to line // var svg = this.toSVG(this.SVGdata.HW,this.SVGdata.D); - if (state.last) {svg.x = 0} - if (state.first || state.nextIsFirst) {delete state.nextIsFirst; if (svg.X) {svg.X = 0}} + if (state.first || state.nextIsFirst) {svg.x = 0} + if (state.last && svg.X) {svg.X = 0} line.Add(svg,line.w,0,true); - } else if (state.first) {state.nextIsFirst = true} else {delete state.nextIsFirst} + } + if (state.first) {state.nextIsFirst = true} else {delete state.nextIsFirst} } });