Skip to content

Commit

Permalink
fix: deal with lack of opts.attachment (#674)
Browse files Browse the repository at this point in the history
* fix: deal with lack of opts.attachment

* docs: add note for this change
  • Loading branch information
delphinus authored Jul 31, 2024
1 parent 7466e3f commit b92e75b
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 0 deletions.
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0

- Fixed an edge case with collecting backlinks.
- Fixed typo in `ObsidianPasteImg`'s command description
- Fixed the case when `opts.attachments` is `nil`.

## [v3.9.0](https://github.com/epwalsh/obsidian.nvim/releases/tag/v3.9.0) - 2024-07-11

Expand Down
3 changes: 3 additions & 0 deletions lua/obsidian/config.lua
Original file line number Diff line number Diff line change
Expand Up @@ -208,6 +208,9 @@ config.ClientOpts.normalize = function(opts, defaults)
end

if opts.image_name_func then
if opts.attachments == nil then
opts.attachments = {}
end
opts.attachments.img_name_func = opts.image_name_func
opts.image_name_func = nil
end
Expand Down

0 comments on commit b92e75b

Please sign in to comment.