diff options
| author | moxie <moxie@3kgcat.fi> | 2026-03-15 06:41:37 +0200 |
|---|---|---|
| committer | moxie <moxie@3kgcat.fi> | 2026-03-15 10:05:06 +0200 |
| commit | 49c1e9d1fc3d6bf8748756a8543d8c1b7287940f (patch) | |
| tree | 8e03c663f10c2a0a17b44bef6a3dbf575582fb2c /lua/muwiki/paths.lua | |
| parent | c8dc1635f8a921269f714117f414bbc7ba24f9fd (diff) | |
refactor: move template/mkdir features to user-configured autocmds
- Remove auto-mkdir autocmd from init.lua (now user-configured)
- Remove template system entirely (now user-configured)
- Rename io.lua -> utils.lua
- Inline single-use functions (handle_web_link, handle_file_link, etc.)
- Remove security warnings for external files
- Remove unused config options: use_template, template, date_fmt
- Simplify utils.resolve() without wiki root validation
- Update all documentation examples
BREAKING CHANGE: Users must now add their own autocmds for:
- Auto-creating directories on save (BufWritePre)
- Applying templates to new files (BufNewFile)
See README.md for updated configuration examples.
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, |
