aboutsummaryrefslogtreecommitdiff
path: root/lua/muwiki/links.lua
diff options
context:
space:
mode:
authormoxie <moxie@3kgcat.fi>2026-03-16 03:16:17 +0200
committermoxie <moxie@3kgcat.fi>2026-03-16 03:16:17 +0200
commitbdf8cf6ecd52e1a2e0ffbe1c8a9da8a9178882d6 (patch)
tree34c99bbbb5ea878ac58088190f8c929ca99159ef /lua/muwiki/links.lua
parent0d5557b5185916913f08215eb7d987d25d3e09e0 (diff)
fix: case-insensitive protocol matching for links
Diffstat (limited to 'lua/muwiki/links.lua')
-rw-r--r--lua/muwiki/links.lua5
1 files changed, 3 insertions, 2 deletions
diff --git a/lua/muwiki/links.lua b/lua/muwiki/links.lua
index 2213dae..9ae22bd 100644
--- a/lua/muwiki/links.lua
+++ b/lua/muwiki/links.lua
@@ -25,10 +25,11 @@ local function is_text_extension(ext)
end
local function get_link_type(target)
- if target:match('^https?://') then
+ local lowered = target:lower()
+ if lowered:match('^https?://') then
return 'web'
end
- if target:match('^file://') then
+ if lowered:match('^file://') then
return 'file'
end
return 'wiki'