|
|
|
|
@ -13,6 +13,7 @@ const fs = require("fs");
|
|
|
|
|
const becca = require("../../becca/becca");
|
|
|
|
|
const RESOURCE_DIR = require('../../services/resource_dir').RESOURCE_DIR;
|
|
|
|
|
const archiver = require('archiver');
|
|
|
|
|
const log = require("../log");
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
* @param {TaskContext} taskContext
|
|
|
|
|
@ -54,7 +55,7 @@ function exportToZip(taskContext, branch, format, res) {
|
|
|
|
|
|
|
|
|
|
let existingExtension = path.extname(fileName).toLowerCase();
|
|
|
|
|
let newExtension;
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
if (fileName.length > 30) {
|
|
|
|
|
fileName = fileName.substr(0, 30);
|
|
|
|
|
}
|
|
|
|
|
@ -254,7 +255,9 @@ ${content}
|
|
|
|
|
</html>`;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
return html.prettyPrint(content, {indent_size: 2});
|
|
|
|
|
return content.length < 100000
|
|
|
|
|
? html.prettyPrint(content, {indent_size: 2})
|
|
|
|
|
: content;
|
|
|
|
|
}
|
|
|
|
|
else if (noteMeta.format === 'markdown') {
|
|
|
|
|
let markdownContent = mdService.toMarkdown(content);
|
|
|
|
|
@ -274,6 +277,8 @@ ${content}
|
|
|
|
|
const notePaths = {};
|
|
|
|
|
|
|
|
|
|
function saveNote(noteMeta, filePathPrefix) {
|
|
|
|
|
log.info(`Exporting note ${noteMeta.noteId}`);
|
|
|
|
|
|
|
|
|
|
if (noteMeta.isClone) {
|
|
|
|
|
const targetUrl = getTargetUrl(noteMeta.noteId, noteMeta);
|
|
|
|
|
|
|
|
|
|
|