Merge branch 'master' into dev

# Conflicts:
#	src/services/import/zip.js
This commit is contained in:
zadam
2022-12-29 10:27:23 +01:00
4 changed files with 28 additions and 13 deletions

View File

@@ -115,7 +115,7 @@ function importEnex(taskContext, file, parentNote) {
let labelName = currentTag;
if (labelName === 'source-url') {
labelName = 'sourceUrl';
labelName = 'pageUrl';
}
labelName = sanitizeAttributeName(labelName);
@@ -139,7 +139,7 @@ function importEnex(taskContext, file, parentNote) {
else if (currentTag === 'source-url') {
resource.attributes.push({
type: 'label',
name: 'sourceUrl',
name: 'pageUrl',
value: text
});
}

View File

@@ -230,6 +230,13 @@ async function importZip(taskContext, fileBuffer, importRootNote) {
absUrl += `${absUrl.length > 0 ? '/' : ''}${url}`;
const {noteMeta} = getMeta(absUrl);
if (!noteMeta) {
log.info(`Could not find note meta for URL '${absUrl}'.`);
return null;
}
const targetNoteId = getNoteId(noteMeta, absUrl);
return targetNoteId;
}
@@ -266,6 +273,10 @@ async function importZip(taskContext, fileBuffer, importRootNote) {
const targetNoteId = getNoteIdFromRelativeUrl(url, filePath);
if (!targetNoteId) {
return match;
}
return `src="api/images/${targetNoteId}/${path.basename(url)}"`;
});
@@ -284,6 +295,10 @@ async function importZip(taskContext, fileBuffer, importRootNote) {
const targetNoteId = getNoteIdFromRelativeUrl(url, filePath);
if (!targetNoteId) {
return match;
}
return `href="#root/${targetNoteId}"`;
});