Skip to content

Commit

Permalink
fixing starting point to toc if available, else use .one files
Browse files Browse the repository at this point in the history
  • Loading branch information
pedr committed May 9, 2024
1 parent c002b72 commit c897e3b
Showing 1 changed file with 2 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -28,8 +28,9 @@ export default class InteropService_Importer_OneNote extends InteropService_Impo
// files that don't have a name seems to be local only and shouldn't be processed
const notebookFiles = zip.getEntries()
.filter(e => e.name !== '.onetoc2' && e.name !== 'OneNote_RecycleBin.onetoc2');
const tableOfContentFiles = notebookFiles.filter(n => n.name.endsWith('.onetoc2'));

const validNotebookFiles = notebookFiles.length ? notebookFiles : zip.getEntries();
const validNotebookFiles = tableOfContentFiles.length ? tableOfContentFiles : notebookFiles;

const outputDirectory = await this.temporaryDirectory_(true);
for (const notebookFile of validNotebookFiles) {
Expand Down

0 comments on commit c897e3b

Please sign in to comment.