Skip to content

Commit

Permalink
fix colSpan preparing
Browse files Browse the repository at this point in the history
  • Loading branch information
liborm85 committed Jun 1, 2017
1 parent d5f951f commit e0e4e13
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 8 deletions.
8 changes: 8 additions & 0 deletions src/docMeasure.js
Original file line number Diff line number Diff line change
Expand Up @@ -518,6 +518,14 @@ DocMeasure.prototype.measureTable = function (node) {
for (row = 0, rows = node.table.body.length; row < rows; row++) {
var rowData = node.table.body[row];
var data = rowData[col];
if (data === undefined) {
console.error('Malformed table row ', rowData, 'in node ', node);
throw 'Malformed table row, a cell is undefined.';
}
if (data === null) { // transform to object
data = '';
}

if (!data._span) {
data = rowData[col] = this.styleStack.auto(data, measureCb(this, data));

Expand Down
14 changes: 6 additions & 8 deletions src/docPreprocessor.js
Original file line number Diff line number Diff line change
Expand Up @@ -88,15 +88,13 @@ DocPreprocessor.prototype.preprocessTable = function (node) {
for (row = 0, rows = node.table.body.length; row < rows; row++) {
var rowData = node.table.body[row];
var data = rowData[col];
if (data === undefined) {
console.error('Malformed table row ', rowData, 'in node ', node);
throw 'Malformed table row, a cell is undefined.';
}
if (data === null) { // transform to object
data = '';
}
if (data !== undefined) {
if (data === null) { // transform to object
data = '';
}

rowData[col] = this.preprocessNode(data);
rowData[col] = this.preprocessNode(data);
}
}
}

Expand Down

0 comments on commit e0e4e13

Please sign in to comment.