You've already forked joplin
mirror of
https://github.com/laurent22/joplin.git
synced 2025-11-26 22:41:17 +02:00
Deskop, Cli: Fixes #10125: ENEX does not import correctly when title of note matches the name of the attachment
This commit is contained in:
@@ -293,6 +293,9 @@ const preProcessFile = async (filePath: string): Promise<string> => {
|
||||
// return newFilePath;
|
||||
};
|
||||
|
||||
const isEvernoteUrl = (url: string) => {
|
||||
return url.toLowerCase().startsWith('evernote://');
|
||||
};
|
||||
|
||||
const restoreNoteLinks = async (notes: SavedNote[], noteTitlesToIds: Record<string, string[]>, importOptions: ImportOptions) => {
|
||||
// --------------------------------------------------------
|
||||
@@ -309,6 +312,8 @@ const restoreNoteLinks = async (notes: SavedNote[], noteTitlesToIds: Record<stri
|
||||
let noteChanged = false;
|
||||
|
||||
for (const link of links) {
|
||||
if (!isEvernoteUrl(link.url)) continue;
|
||||
|
||||
const matchingNoteIds = noteTitlesToIds[link.title];
|
||||
if (matchingNoteIds && matchingNoteIds.length === 1) {
|
||||
note.body = note.body.replace(link.url, `:/${matchingNoteIds[0]}`);
|
||||
|
||||
Reference in New Issue
Block a user