mirror of
https://github.com/zadam/trilium.git
synced 2025-02-01 20:10:27 +08:00
fix exporting huge text notes (export would get stuck on HTML pretty printing)
This commit is contained in:
parent
d6016f9b81
commit
23daaa2387
1 changed files with 7 additions and 2 deletions
|
@ -13,6 +13,7 @@ const fs = require("fs");
|
||||||
const becca = require("../../becca/becca");
|
const becca = require("../../becca/becca");
|
||||||
const RESOURCE_DIR = require('../../services/resource_dir').RESOURCE_DIR;
|
const RESOURCE_DIR = require('../../services/resource_dir').RESOURCE_DIR;
|
||||||
const archiver = require('archiver');
|
const archiver = require('archiver');
|
||||||
|
const log = require("../log");
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @param {TaskContext} taskContext
|
* @param {TaskContext} taskContext
|
||||||
|
@ -254,7 +255,9 @@ ${content}
|
||||||
</html>`;
|
</html>`;
|
||||||
}
|
}
|
||||||
|
|
||||||
return html.prettyPrint(content, {indent_size: 2});
|
return content.length < 100000
|
||||||
|
? html.prettyPrint(content, {indent_size: 2})
|
||||||
|
: content;
|
||||||
}
|
}
|
||||||
else if (noteMeta.format === 'markdown') {
|
else if (noteMeta.format === 'markdown') {
|
||||||
let markdownContent = mdService.toMarkdown(content);
|
let markdownContent = mdService.toMarkdown(content);
|
||||||
|
@ -274,6 +277,8 @@ ${content}
|
||||||
const notePaths = {};
|
const notePaths = {};
|
||||||
|
|
||||||
function saveNote(noteMeta, filePathPrefix) {
|
function saveNote(noteMeta, filePathPrefix) {
|
||||||
|
log.info(`Exporting note ${noteMeta.noteId}`);
|
||||||
|
|
||||||
if (noteMeta.isClone) {
|
if (noteMeta.isClone) {
|
||||||
const targetUrl = getTargetUrl(noteMeta.noteId, noteMeta);
|
const targetUrl = getTargetUrl(noteMeta.noteId, noteMeta);
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue