AutoYADM commit: 2024-12-03 18:40:03
This commit is contained in:
parent
e5f8a2b615
commit
372204f6c6
1 changed files with 1 additions and 25 deletions
|
@ -8,30 +8,6 @@ local function resolver(document_path, image_path, fallback)
|
|||
return fallback(document_path, image_path)
|
||||
end
|
||||
|
||||
local function resolver_ahmed(document_path, image_path, fallback)
|
||||
-- my vault root
|
||||
vim.env.NOTES_DIR = "/home/fic/second-brain"
|
||||
local working_dir = vim.fn.getcwd()
|
||||
local notes_dir = vim.fn.expand(vim.env.NOTES_DIR)
|
||||
-- Format image path for Obsidian notes
|
||||
if working_dir:find(notes_dir, 1, true) then
|
||||
return vim.fn.shellescape(notes_dir .. "/" .. image_path)
|
||||
end
|
||||
-- Fallback to the default behavior
|
||||
return fallback(document_path, image_path)
|
||||
end
|
||||
local function resolver_ahmed_fixed(document_path, image_path, fallback)
|
||||
-- my vault root
|
||||
vim.env.NOTES_DIR = "/home/fic/second-brain"
|
||||
local working_dir = vim.fn.getcwd()
|
||||
local notes_dir = vim.fn.expand(vim.env.NOTES_DIR)
|
||||
-- Format image path for Obsidian notes
|
||||
if working_dir:find(notes_dir, 1, true) then
|
||||
return (notes_dir .. "/" .. image_path)
|
||||
end
|
||||
-- Fallback to the default behavior
|
||||
return fallback(document_path, image_path)
|
||||
end
|
||||
return {
|
||||
{
|
||||
"3rd/image.nvim",
|
||||
|
@ -41,7 +17,7 @@ return {
|
|||
integrations = {
|
||||
markdown = {
|
||||
enabled = true,
|
||||
resolve_image_path = resolver_ahmed,
|
||||
resolve_image_path = resolver,
|
||||
},
|
||||
},
|
||||
},
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue