Skip to content

Commit

Permalink
Trailing white space causes bug.
Browse files Browse the repository at this point in the history
  • Loading branch information
KeeTraxx committed Sep 23, 2015
1 parent eeaee07 commit 0c47aef
Show file tree
Hide file tree
Showing 4 changed files with 6 additions and 2 deletions.
2 changes: 1 addition & 1 deletion lib/Sheet.js
Original file line number Diff line number Diff line change
Expand Up @@ -150,7 +150,7 @@ function Sheet(basedir, file, contents, sharedStrings) {
if (cell.$.t == 's') {
return sharedStrings[parseInt(cell.v)].t[0];
} else if(cell.f && cell.v) {
return cell.v[0];
return cell.v[0].hasOwnProperty('_') ? cell.v[0]._ : cell.v[0];
} else if (cell.f) {
// formula
return '=' + cell.f[0];
Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "kexcel",
"version": "2.0.12",
"version": "2.0.13",
"description": "Create or open and then edit existing XLSX files",
"keywords": [
"xlsx",
Expand Down
4 changes: 4 additions & 0 deletions test/functionvalues.js
Original file line number Diff line number Diff line change
Expand Up @@ -18,4 +18,8 @@ describe('Return values instead of functions', function () {
workbook.getSheet(0).getCellValue(1,1).should.equal('42');
});

it('Trailing white space test', function () {
workbook.getSheet(0).getCellValue(2,1).should.equal('test with trailing white space ');
});

});
Binary file modified test/input-files/42.xlsx
Binary file not shown.

0 comments on commit 0c47aef

Please sign in to comment.