Skip to content

Commit

Permalink
Merge pull request #58 from aqum/preserve-line-breaks-in-docx
Browse files Browse the repository at this point in the history
Fixed regex for trimming multiple spaces
  • Loading branch information
dbashford committed Aug 26, 2015
2 parents df96067 + 9678186 commit b4e22e1
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 1 deletion.
2 changes: 1 addition & 1 deletion lib/util.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ var exec = require('child_process').exec;

var SINGLE_QUOTES = /[\u2018|\u2019]/g
, DOUBLE_QUOTES = /[\u201C|\u201D]/g
, MULTI_SPACES = /\s{2,}/g
, MULTI_SPACES = /[^\S\r\n]{2,}/g
, NON_ASCII_CHARS = /[^\x00-\x7F\x80-\xFF]/g
;

Expand Down
11 changes: 11 additions & 0 deletions test/util_test.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
var util = require('../lib/util');

describe('textract util', function() {

it('should normalize text output', function() {
var text = " “” ‘’ ą \n\n some text";
var result = util.replaceTextChars(text);
expect(result).to.equal("\"\" '' \n\n some text");
});

});

0 comments on commit b4e22e1

Please sign in to comment.