Skip to content

Commit

Permalink
fix: incorect identification of the target for replacement of attachm…
Browse files Browse the repository at this point in the history
…ent name.
  • Loading branch information
makaanneo committed Jan 14, 2022
1 parent 347a823 commit beb4138
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 2 deletions.
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -3,3 +3,4 @@ node_modules/
publish/
build/config.gypi
coverage/
debug.log
5 changes: 3 additions & 2 deletions src/index.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
import joplin from 'api';
import { ToolbarButtonLocation } from 'api/types';
import * as path from 'path';

joplin.plugins.register({
onStart: async function () {
Expand Down Expand Up @@ -33,8 +34,8 @@ joplin.plugins.register({
}
);
const replacedBody = selectedNote.body.replace(
firstResource.title,
resource.title
path.basename(firstResource.title, firstResource.file_extension),
path.basename(resource.title, resource.file_extension)
);
const changedNote = await joplin.data.put(
['notes', selectedNote.id],
Expand Down

0 comments on commit beb4138

Please sign in to comment.