mirror of
				https://github.com/zadam/trilium.git
				synced 2025-10-31 18:36:30 +01:00 
			
		
		
		
	improved ZIP import validation and error handling
This commit is contained in:
		| @@ -214,13 +214,13 @@ function exportToZip(taskContext, branch, format, res) { | ||||
|     } | ||||
|  | ||||
|     function findLinks(content, noteMeta) { | ||||
|         content = content.replace(/src="[^"]*api\/images\/([a-zA-Z0-9]+)\/[^"]*"/g, (match, targetNoteId) => { | ||||
|         content = content.replace(/src="[^"]*api\/images\/([a-zA-Z0-9_]+)\/[^"]*"/g, (match, targetNoteId) => { | ||||
|             const url = getTargetUrl(targetNoteId, noteMeta); | ||||
|  | ||||
|             return url ? `src="${url}"` : match; | ||||
|         }); | ||||
|  | ||||
|         content = content.replace(/href="[^"]*#root[a-zA-Z0-9\/]*\/([a-zA-Z0-9]+)\/?"/g, (match, targetNoteId) => { | ||||
|         content = content.replace(/href="[^"]*#root[a-zA-Z0-9_\/]*\/([a-zA-Z0-9_]+)\/?"/g, (match, targetNoteId) => { | ||||
|             const url = getTargetUrl(targetNoteId, noteMeta); | ||||
|  | ||||
|             return url ? `href="${url}"` : match; | ||||
|   | ||||
		Reference in New Issue
	
	Block a user