Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 3 additions & 1 deletion lua/markdown-notes/links.lua
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,10 @@ local M = {}

-- Helper function to insert a link at cursor position
local function insert_link_at_cursor(file_path)
-- Normalize path by removing leading ./ if present
local normalized_path = file_path:gsub("^%./", "")
-- Remove .md extension but keep the full path
local link_path = file_path:gsub("%.md$", "")
local link_path = normalized_path:gsub("%.md$", "")
local link = "[[" .. link_path .. "]]"

-- Insert link at cursor
Expand Down