imported internal links crash ckeditor, #1979

This commit is contained in:
zadam
2021-05-25 21:45:59 +02:00
parent 3c7232f427
commit b9639bffce
4 changed files with 11 additions and 3 deletions

View File

@@ -307,6 +307,14 @@ async function importZip(taskContext, fileBuffer, importRootNote) {
return `href="#root/${targetNoteId}"`;
});
content = content.replace(/data-note-path="([^"]*)"/g, (match, notePath) => {
const noteId = notePath.split("/").pop();
const targetNoteId = noteIdMap[noteId];
return `data-note-path="root/${targetNoteId}"`;
});
if (noteMeta) {
const includeNoteLinks = (noteMeta.attributes || [])
.filter(attr => attr.type === 'relation' && attr.name === 'includeNoteLink');