Skip to content

Commit 047466a

Browse files
authored
Merge pull request #30 from sonnenkern/develop
Develop
2 parents 00a9b10 + 453f291 commit 047466a

File tree

3 files changed

+9
-9
lines changed

3 files changed

+9
-9
lines changed

lib/QuipProcessor.js

+6-6
Original file line numberDiff line numberDiff line change
@@ -195,7 +195,7 @@ class QuipProcessor {
195195
this.logger.debug(`_processReference: replacement=${reference.replacement}, path=${path}`);
196196
return html.replace(reference.replacement, path);
197197
}
198-
198+
199199
_renderDocumentHtml(html, title, path) {
200200
const pathDeepness = path.split("/").length-1;
201201

@@ -217,7 +217,7 @@ class QuipProcessor {
217217

218218
return html;
219219
}
220-
220+
221221
async _getThreadMessagesHtml(quipThread, path) {
222222
let html = '';
223223
const pathDeepness = path.split("/").length-1;
@@ -320,12 +320,12 @@ class QuipProcessor {
320320
async _processDocumentThread(quipThread, path) {
321321
const pathDeepness = path.split("/").length-1;
322322
let threadHtml = quipThread.html;
323-
323+
324324
//look up for images in html
325325
let matches = this._getMatchGroups(threadHtml,
326326
"src='(/blob/([\\w-]+)/([\\w-]+))'",
327327
['replacement', 'threadId', 'blobId']);
328-
328+
329329
//replace blob references for images
330330
for(const image of matches) {
331331
threadHtml = await this._processFile(threadHtml, image, path, this.options.embeddedImages);
@@ -423,7 +423,7 @@ class QuipProcessor {
423423
async _processFolders(quipFolders, path) {
424424
const promises = [];
425425
for(const index in quipFolders) {
426-
promises.push(this._processFolder(quipFolders[index], `${path}${quipFolders[index].folder.title}/`));
426+
promises.push(this._processFolder(quipFolders[index], `${path}${sanitizeFilename(quipFolders[index].folder.title)}/`));
427427
}
428428
await Promise.all(promises);
429429
}
@@ -549,4 +549,4 @@ class QuipProcessor {
549549
}
550550
}
551551

552-
module.exports = QuipProcessor;
552+
module.exports = QuipProcessor;

lib/__tests__/QuipProcessor.test.js

+2-2
Original file line numberDiff line numberDiff line change
@@ -369,8 +369,8 @@ describe('methods tests', () => {
369369
};
370370
await quipProcessor._processFolders(mockFolders, "/aaa/");
371371
expect(quipProcessor._processFolder).toHaveBeenCalledTimes(2);
372-
expect(quipProcessor._processFolder).toHaveBeenCalledWith(mockFolders.folder1, `/aaa/${mockFolders.folder1.folder.title}/`);
373-
expect(quipProcessor._processFolder).toHaveBeenCalledWith(mockFolders.folder2, `/aaa/${mockFolders.folder2.folder.title}/`);
372+
expect(quipProcessor._processFolder).toHaveBeenCalledWith(mockFolders.folder1, `/aaa/${mockFolders.folder1.folder.title}_SANITIZED/`);
373+
expect(quipProcessor._processFolder).toHaveBeenCalledWith(mockFolders.folder2, `/aaa/${mockFolders.folder2.folder.title}_SANITIZED/`);
374374
});
375375
});
376376

package.json

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "quip-export",
3-
"version": "2.3.0",
3+
"version": "2.3.1",
44
"description": "Export all folders and documents from Quip",
55
"main": "index.js",
66
"jest": {

0 commit comments

Comments
 (0)