dbashford/textract

Problems with Rich Text Format files with spaces in their filenames

agrimm opened this issue · 5 comments

If there is a space in the value for filePath, then it can't extract from a Rich Text Format file:

var textract = require('textract');
var path = require('path')
  , fs = require("fs")
  ;

var config = {};
config.preserveLineBreaks = true;

var processText = function (error, text) {
  console.log(text);
};

var filePath = "Example filename.rtf";
// Works if the following is used
// var filePath = "ExampleFilename.rtf";

textract.fromFileWithPath(filePath, config, processText);
// Also works if the following is used
// var textBuff = fs.readFileSync(filePath);
// textract.fromBufferWithName(filePath, textBuff, config, processText);

However, if the filePath is changed to not have a space in it, or if fromBufferWithName is used, it works fine.

This is using the 2.0.0 release of textract.

This on Mac, ya?

nevermind, reproduced and fixed, thanks!

Published with textract 2.1

Thank you!