From 786ed7e34f5d6fe8adf80f7f5bae7abc6a037740 Mon Sep 17 00:00:00 2001 From: Michael Williamson Date: Tue, 10 May 2016 21:29:20 +0100 Subject: Avoid merging in non-conforming cells --- lib/docx/body-reader.js | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'lib') diff --git a/lib/docx/body-reader.js b/lib/docx/body-reader.js index 70d5402..0849aa1 100644 --- a/lib/docx/body-reader.js +++ b/lib/docx/body-reader.js @@ -273,6 +273,7 @@ function BodyReader(options) { row.children.forEach(function(cell) { if (cell._vMerge === "continue" && columns[cellIndex]) { columns[cellIndex].rowSpan++; + cell._delete = true; } else { columns[cellIndex] = cell; } @@ -282,7 +283,7 @@ function BodyReader(options) { rows.forEach(function(row, rowIndex) { row.children = row.children.filter(function(cell) { - return cell._vMerge !== "continue"; + return !cell._delete; }); row.children.forEach(function(cell) { delete cell._vMerge; -- cgit v1.2.3