Skip to content

Commit

Permalink
feat: Add a option to keep attachment file name (#72)
Browse files Browse the repository at this point in the history
  • Loading branch information
sxr1223 authored Feb 23, 2024
1 parent d534107 commit eb9437f
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
2 changes: 1 addition & 1 deletion src/main.ts
Original file line number Diff line number Diff line change
Expand Up @@ -89,7 +89,7 @@ export default class MarkdownExportPlugin extends Plugin {
);
}

onunload() {}
onunload() { }

async loadSettings() {
this.settings = Object.assign(
Expand Down
4 changes: 2 additions & 2 deletions src/utils.ts
Original file line number Diff line number Diff line change
Expand Up @@ -351,7 +351,7 @@ export async function tryCopyMarkdownByRead(
const fileName = path.parse(path.basename(imageLink)).name;
const imageLinkMd5 = plugin.settings.fileNameEncode
? md5(imageLink)
: fileName;
: encodeURI(fileName);
const imageExt = path.extname(imageLink);
// Unify the link separator in obsidian as a forward slash instead of the default back slash in windows, so that the referenced images can be displayed properly

Expand Down Expand Up @@ -423,4 +423,4 @@ export async function tryCopyMarkdownByRead(
throw error;
}
}
}
}

0 comments on commit eb9437f

Please sign in to comment.