mirror of
https://github.com/TriliumNext/Notes.git
synced 2025-09-09 15:30:45 +08:00
fix(import/zip): support special characters for attachments
This commit is contained in:
parent
132a8f7c65
commit
800424405a
@ -1,7 +1,7 @@
|
||||
"use strict";
|
||||
|
||||
import BAttribute from "../../becca/entities/battribute.js";
|
||||
import { removeTextFileExtension, newEntityId, getNoteTitle, processStringOrBuffer } from "../../services/utils.js";
|
||||
import { removeTextFileExtension, newEntityId, getNoteTitle, processStringOrBuffer, unescapeHtml } from "../../services/utils.js";
|
||||
import log from "../../services/log.js";
|
||||
import noteService from "../../services/notes.js";
|
||||
import attributeService from "../../services/attributes.js";
|
||||
@ -109,11 +109,12 @@ async function importZip(taskContext: TaskContext, fileBuffer: Buffer, importRoo
|
||||
|
||||
let parent: NoteMeta | undefined = undefined;
|
||||
|
||||
for (const segment of pathSegments) {
|
||||
for (let segment of pathSegments) {
|
||||
if (!cursor?.children?.length) {
|
||||
return {};
|
||||
}
|
||||
|
||||
segment = unescapeHtml(segment);
|
||||
parent = cursor;
|
||||
if (parent.children) {
|
||||
cursor = parent.children.find((file) => file.dataFileName === segment || file.dirFileName === segment);
|
||||
|
Loading…
x
Reference in New Issue
Block a user