Skip to content

Commit

Permalink
clean up Client:should_save_frontmatter()
Browse files Browse the repository at this point in the history
  • Loading branch information
epwalsh committed Mar 22, 2024
1 parent be075a1 commit 6a81ca9
Showing 1 changed file with 4 additions and 8 deletions.
12 changes: 4 additions & 8 deletions lua/obsidian/client.lua
Original file line number Diff line number Diff line change
Expand Up @@ -282,17 +282,13 @@ end
Client.should_save_frontmatter = function(self, note)
if not note:should_save_frontmatter() then
return false
end
if self.opts.disable_frontmatter == nil then
return true
end
if type(self.opts.disable_frontmatter) == "boolean" then
elseif type(self.opts.disable_frontmatter) == "boolean" then
return not self.opts.disable_frontmatter
end
if type(self.opts.disable_frontmatter) == "function" then
elseif type(self.opts.disable_frontmatter) == "function" then
return not self.opts.disable_frontmatter(tostring(self:vault_relative_path(note.path, { strict = true })))
else
return true
end
return true
end

--- Run an obsidian command directly.
Expand Down

0 comments on commit 6a81ca9

Please sign in to comment.