Skip to content

Commit

Permalink
fix(summary): escape ws_root special characters (nvim-neorg#1012)
Browse files Browse the repository at this point in the history
  • Loading branch information
git-girl authored and benlubas committed Jan 11, 2024
1 parent e5577c0 commit e09f35d
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion lua/neorg/modules/core/summary/module.lua
Original file line number Diff line number Diff line change
Expand Up @@ -89,7 +89,8 @@ module.load = function()
if not norgname then
norgname = filename
end
norgname = norgname:gsub("^" .. ws_root, "")
local escaped_ws_root = ws_root:gsub("([%(%)%.%%%+%-%*%?%[%^%$%]])", "%%%1")
norgname = string.sub(norgname, string.len(ws_root) + 1)

-- normalise categories into a list. Could be vim.NIL, a number, a string or a list ...
if not metadata.categories or metadata.categories == vim.NIL then
Expand Down

0 comments on commit e09f35d

Please sign in to comment.