diff --git a/src/Parse.js b/src/Parse.js index 283e852..3a546b8 100644 --- a/src/Parse.js +++ b/src/Parse.js @@ -285,7 +285,7 @@ _html2canvas.Parse = function ( images, options ) { text_align = text_align.replace(["-webkit-auto"],["auto"]); - if (options.letterRendering === false && /^(left|right|justify|auto)$/.test(text_align) && /^(normal|none)$/.test(letter_spacing)){ + if (options.letterRendering === false && /^(left|right|justify|auto)$/.test(text_align) && /^(normal|none|0px)$/.test(letter_spacing)){ // this.setContextVariable(ctx,"textAlign",text_align); renderList = textNode.nodeValue.split(/(\b| )/); @@ -363,7 +363,10 @@ _html2canvas.Parse = function ( images, options ) { continue; } - newTextNode = oldTextNode.splitText(renderList[c].length); + if (i < listLen-1) + newTextNode = oldTextNode.splitText(renderList[c].length); + else + newTextNode = null; parent = oldTextNode.parentNode; wrapElement = doc.createElement('wrapper');