mirror of
https://github.com/zadam/trilium.git
synced 2025-11-17 18:50:41 +01:00
fix thumbnails with chinese titles, closes #4478
This commit is contained in:
@@ -303,7 +303,8 @@ function importEnex(taskContext, file, parentNote) {
|
||||
|
||||
const attachment = imageService.saveImageToAttachment(noteEntity.noteId, resource.content, originalName, taskContext.data.shrinkImages);
|
||||
|
||||
const sanitizedTitle = attachment.title.replace(/[^a-z0-9-.]/gi, "");
|
||||
// We might want to replace with escape-html. For non-latin-based languages, this doesn't work well.
|
||||
const sanitizedTitle = attachment.title.replace(/[^a-z0-9-.]/gi, "") || "attachment";
|
||||
const url = `api/attachments/${attachment.attachmentId}/image/${sanitizedTitle}`;
|
||||
const imageLink = `<img src="${url}">`;
|
||||
|
||||
|
||||
Reference in New Issue
Block a user