Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix(summary): escape ws_root special characters #1012

Merged
merged 2 commits into from
Sep 13, 2023
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
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
Loading