diff options
Diffstat (limited to 'lua/muwiki/paths.lua')
| -rw-r--r-- | lua/muwiki/paths.lua | 20 |
1 files changed, 0 insertions, 20 deletions
diff --git a/lua/muwiki/paths.lua b/lua/muwiki/paths.lua index f679888..c2f8fdb 100644 --- a/lua/muwiki/paths.lua +++ b/lua/muwiki/paths.lua @@ -26,26 +26,6 @@ function M.strip_file_protocol(url) return url:gsub('^file://', '') end -function M.is_within_wiki(filepath, wiki_root) - local real_path = vim.fn.resolve(filepath) - local real_root = vim.fn.resolve(wiki_root) - - local normalized_path = vim.fs.normalize(real_path) - local normalized_root = vim.fs.normalize(real_root) - - return vim.startswith(normalized_path, normalized_root) -end - -function M.validate_within_wiki(resolved_path, wiki_root, original_path) - if not M.is_within_wiki(resolved_path, wiki_root) then - vim.notify( - string.format('Warning: Resolved path outside wiki root: %s', original_path), - vim.log.levels.WARN - ) - end - return resolved_path -end - local ALLOWED_SCHEMES = { http = true, https = true, |
