diff --git a/src/public/stylesheets/style.css b/src/public/stylesheets/style.css index 8b19ec093..204ad456e 100644 --- a/src/public/stylesheets/style.css +++ b/src/public/stylesheets/style.css @@ -406,7 +406,7 @@ div.ui-tooltip { padding: 10px; background: var(--accented-background-color); width: 150px; - height: 90px; + height: 85px; line-height: 2em; margin-right: 20px; border-radius: 15px; diff --git a/src/services/export/tar.js b/src/services/export/tar.js index 3bdb13946..5cb6c656b 100644 --- a/src/services/export/tar.js +++ b/src/services/export/tar.js @@ -85,23 +85,29 @@ async function exportToTar(exportContext, branch, format, res) { return; } - const baseFileName = sanitize(branch.prefix ? (branch.prefix + ' - ' + note.title) : note.title); + const completeTitle = branch.prefix ? (branch.prefix + ' - ' + note.title) : note.title; + const baseFileName = sanitize(completeTitle); + const notePath = parentMeta.notePath.concat([note.noteId]); if (note.noteId in noteIdToMeta) { - const fileName = getUniqueFilename(existingFileNames, baseFileName + ".clone"); + const fileName = getUniqueFilename(existingFileNames, baseFileName + ".clone." + (format === 'html' ? 'html' : 'md')); return { isClone: true, noteId: note.noteId, + notePath: notePath, + title: note.title, prefix: branch.prefix, - dataFileName: fileName + dataFileName: fileName, + type: 'text', // export will have text description, + format: format }; } const meta = { isClone: false, noteId: note.noteId, - notePath: parentMeta.notePath.concat([note.noteId]), + notePath: notePath, title: note.title, notePosition: branch.notePosition, prefix: branch.prefix, @@ -181,7 +187,8 @@ async function exportToTar(exportContext, branch, format, res) { const meta = noteIdToMeta[targetPath[targetPath.length - 1]]; - url += meta.dataFileName; + // link can target note which is only "folder-note" and as such will not have a file in an export + url += meta.dataFileName || meta.dirFileName; return url; } @@ -202,9 +209,7 @@ async function exportToTar(exportContext, branch, format, res) { return content; } - async function prepareContent(note, noteMeta) { - let content = await note.getContent(); - + function prepareContent(title, content, noteMeta) { if (['html', 'markdown'].includes(noteMeta.format)) { content = content.toString(); @@ -216,7 +221,7 @@ async function exportToTar(exportContext, branch, format, res) { content = `
-This is a clone of a note. Go to its primary location.
`; + + content = prepareContent(noteMeta.title, content, noteMeta); pack.entry({name: filePathPrefix + noteMeta.dataFileName, size: content.length}, content); return; @@ -254,7 +263,7 @@ ${content} notePaths[note.noteId] = filePathPrefix + (noteMeta.dataFileName || noteMeta.dirFileName); if (noteMeta.dataFileName) { - const content = await prepareContent(note, noteMeta); + const content = prepareContent(noteMeta.title, await note.getContent(), noteMeta); pack.entry({name: filePathPrefix + noteMeta.dataFileName, size: content.length}, content); }