Skip to content

Commit

Permalink
fix: escape special characters in link titles
Browse files Browse the repository at this point in the history
  • Loading branch information
vhyrro committed Jul 31, 2021
1 parent 965fbe0 commit 0bfbaaf
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion lua/telescope/_extensions/neorg/insert_link.lua
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,7 @@ return function(opts)
actions_set.select:replace(function()
local entry = actions.get_selected_entry()
actions.close(prompt_bufnr)
vim.api.nvim_put({ "[" .. entry.ordinal:gsub(":$", "") .. "]" .. "(" .. entry.display:gsub("^(%W+)%s+", "%1") .. ")" }, "c", false, true)
vim.api.nvim_put({ "[" .. entry.ordinal:gsub(":$", "") .. "]" .. "(" .. entry.display:gsub("^(%W+)%s+.+", "%1") .. entry.ordinal:gsub("[%*#%|_]", "\\%1") .. ")" }, "c", false, true)
vim.api.nvim_feedkeys("f)a", "t", false)
end)
return true
Expand Down

0 comments on commit 0bfbaaf

Please sign in to comment.