Skip to content

Commit

Permalink
Fix issue with createByJson for docx documents which would strip the …
Browse files Browse the repository at this point in the history
…very first element from the JSON object
  • Loading branch information
Michael Irigoyen committed Jul 8, 2017
1 parent b3986ff commit 0ef9d35
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions lib/gendocx.js
Expand Up @@ -722,8 +722,8 @@ function makeDocx ( genobj, new_type, options, gen_private, type_info ) {
dataArray = [].concat(dataArray || []);
dataArray.forEach(function(data) {
if(Array.isArray(data)) {
newP = genobj.createP(data.shift() || {});
data.forEach( function(d) {
newP = genobj.createP(data[0] || {});
data.forEach(function(d) {
newP = genobj.createJson(d, newP);
});
} else {
Expand Down

0 comments on commit 0ef9d35

Please sign in to comment.