diff options
| author | moxie <moxie@3kgcat.fi> | 2026-03-16 02:21:16 +0200 |
|---|---|---|
| committer | moxie <moxie@3kgcat.fi> | 2026-03-16 02:30:19 +0200 |
| commit | c566653a645c8317f336043117766745304b7887 (patch) | |
| tree | 2014fc5f94dd7b0c7f820f0ba92cc064abf2988e /lua/muwiki/config.lua | |
| parent | 379e5af690c8ab298ef5d32fcaddae070c4ff8a5 (diff) | |
refactor: normalize text_extensions at config time
Diffstat (limited to 'lua/muwiki/config.lua')
| -rw-r--r-- | lua/muwiki/config.lua | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/lua/muwiki/config.lua b/lua/muwiki/config.lua index 831e406..362cc26 100644 --- a/lua/muwiki/config.lua +++ b/lua/muwiki/config.lua @@ -23,6 +23,13 @@ function M.setup(opts) for key, value in pairs(opts) do if key == 'dirs' then -- handled above + elseif key == 'text_extensions' then + -- Normalize extensions by stripping leading dots + M.options.text_extensions = {} + for _, ext in ipairs(value) do + local normalized = ext:gsub("^%.", "") + table.insert(M.options.text_extensions, normalized) + end elseif M.options[key] ~= nil then M.options[key] = value end |
