diff options
| author | moxie <moxie@3kgcat.fi> | 2026-03-15 15:31:00 +0200 |
|---|---|---|
| committer | moxie <moxie@3kgcat.fi> | 2026-03-15 15:31:00 +0200 |
| commit | c7a268de6279f4aef74e5d410c8cb084b55f8bc8 (patch) | |
| tree | 451e9f4988d6fd5e60d2e03fb83940f821b9d7e1 /lua | |
| parent | 37cd862b5e0fbd7ae4d421e0cad8e198d5653381 (diff) | |
fix: normalize text_extensions to support both "ext" and ".ext" formats
Diffstat (limited to 'lua')
| -rw-r--r-- | lua/muwiki/links.lua | 9 |
1 files changed, 8 insertions, 1 deletions
diff --git a/lua/muwiki/links.lua b/lua/muwiki/links.lua index 72bb229..94b3efb 100644 --- a/lua/muwiki/links.lua +++ b/lua/muwiki/links.lua @@ -5,7 +5,14 @@ local M = {} local function is_text_extension(ext) local text_exts = config.options.text_extensions or {} - return vim.list_contains(text_exts, ext) + ext = ext:gsub("^%.", "") + for _, text_ext in ipairs(text_exts) do + local normalized = text_ext:gsub("^%.", "") + if normalized == ext then + return true + end + end + return false end local function get_link_type(target) |
