-- HF stands for High Frequency.
-- This Module augments the built-in HF
local HF = mw.InfoboxBuilderHF
----------------------------
-- Libraries of functions --
----------------------------
-- Parses invocation parameters, trims whitespace, and removes blanks
local getArgs = require('Dev:Arguments').getArgs
-- internal function, for use with other Lua modules
-- eliminates the link portion wikitext of a File: call, leaving only the bare filename.
function HF._stripFileWrapper (s)
if type(s) == 'string' then
return (s
:gsub("%[*(.*)", '%1') -- leading brackets
:gsub("([%a]*)|+.*", '%1') -- arguments
:gsub("([%a]*)%]*", '%1') -- closing brackets
)
else
return false
end
end
----------------------
-- Public functions --
----------------------
-- public function, for use in templates or articles
-- eliminates the link portion wikitext of a File: call, leaving only the bare filename.
function HF.stripFileWrapper(frame)
local args = getArgs(frame)
return HF._stripFileWrapper(args[1])
end
return HF