mirror of
				https://github.com/zadam/trilium.git
				synced 2025-10-31 10:26:08 +01:00 
			
		
		
		
	fix exporting huge text notes (export would get stuck on HTML pretty printing)
This commit is contained in:
		| @@ -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 | ||||
| @@ -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); | ||||
|  | ||||
|   | ||||
		Reference in New Issue
	
	Block a user