Skip to content

Commit

Permalink
#23 remove control characters from strings
Browse files Browse the repository at this point in the history
  • Loading branch information
pietersv committed Jun 8, 2022
1 parent 86b4dc2 commit e5b2861
Show file tree
Hide file tree
Showing 4 changed files with 6 additions and 4 deletions.
3 changes: 2 additions & 1 deletion lib/msexcel-builder.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion lib/msexcel-builder.js.map

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
"xlsx",
"excel"
],
"version": "0.4.9",
"version": "0.4.10",
"repository": {
"type": "git",
"url": "git://github.com/protobi/msexcel-builder.git"
Expand Down
3 changes: 2 additions & 1 deletion src/msexcel-builder.coffee
Original file line number Diff line number Diff line change
Expand Up @@ -855,7 +855,8 @@ class Sheet
@[key] col, row, str[key]
else console.error('Ignoring ', key, col, row, str[key])
else if typeof str == 'string'
if str != null and str != ''
if str != null and str != '' and str != undefined
str = str.replace(/[\u0000-\u001F\u007F-\u009F\u200b]/g, "")
@data[row][col].v = @book.ss.str2id('' + str)
return @data[row][col].dataType = 'string'

Expand Down

0 comments on commit e5b2861

Please sign in to comment.