aboutsummaryrefslogtreecommitdiff
path: root/lib
diff options
context:
space:
mode:
authorMichael Williamson <mike@zwobble.org>2016-05-10 21:29:20 +0100
committerMichael Williamson <mike@zwobble.org>2016-05-10 21:29:20 +0100
commit786ed7e34f5d6fe8adf80f7f5bae7abc6a037740 (patch)
tree7d90a6fb2753aed42f2c63510306b67366bdb730 /lib
parent1417c93bebe0426be97d8f334fc279a6eb10deda (diff)
Avoid merging in non-conforming cells
Diffstat (limited to 'lib')
-rw-r--r--lib/docx/body-reader.js3
1 files changed, 2 insertions, 1 deletions
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;