Skip to content

Commit 5e0829d

Browse files
Desktop: Fixes #15132: Fix hang when importing certain OneNote files (#15159)
1 parent 105dd5c commit 5e0829d

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

packages/lib/services/interop/InteropService_Importer_OneNote.ts

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -226,6 +226,10 @@ export default class InteropService_Importer_OneNote extends InteropService_Impo
226226
(dom: Document, currentFolder: string) => this.convertExternalLinksToInternalLinks_(dom, currentFolder, idMap),
227227
(dom: Document, _currentFolder: string) => Promise.resolve(this.simplifyHtml_(dom)),
228228
];
229+
// Workaround: HTML read directly from the filesystem can cause parseFromString to hang.
230+
// Force creation of a new string.
231+
// See https://github.com/laurent22/joplin/issues/15132
232+
html = `${html} `.substring(0, html.length);
229233
const dom = this.domParser.parseFromString(html, 'text/html');
230234

231235
let changed = false;

0 commit comments

Comments
 (0)