shorten markdown links to pasted images

This commit is contained in:
Rene Schallner
2021-11-26 05:30:11 +01:00
parent ea44fc04fc
commit 723a2d25ef
3 changed files with 6 additions and 6 deletions

View File

@@ -40,7 +40,7 @@ local ZkCfg = {
-- image link style
-- wiki: ![[image name]]
-- markdown: ![image name](image_subdir/xxxxx.png)
-- markdown: ![](image_subdir/xxxxx.png)
image_link_style = "wiki",
-- integrate with calendar-vim
@@ -117,7 +117,7 @@ local imgFromClipboard = function()
os.execute("xclip -selection clipboard -t image/png -o > " .. pngpath)
if file_exists(pngpath) then
if ZkCfg.image_link_style == "markdown" then
vim.api.nvim_put({ "![" .. pngname .. "](" .. relpath .. "]" }, "", false, true)
vim.api.nvim_put({ "![](" .. relpath .. "]" }, "", false, true)
else
vim.api.nvim_put({ "![[" .. pngname .. "]]" }, "", false, true)
end