This module implements {{if empty}}
.
-- Prevent substitution.
if mw.isSubsting() then
return require("Module:unsubst")
end
local export = {}
-- Do all the work via ], as it returns a list of parameters
-- with any gaps removed, treating blank parameters as gaps, so simply return
-- the first value, falling back to the empty string. Blank parameters are
-- (obviously) permitted, but missing ones are not (i.e. using named parameters
-- to specify non-contiguous numeric parameters like |1000=).
function export.main(frame)
return require("Module:parameters").process(frame:getParent().args, {
= {list = true, disallow_missing = true}
}) or ""
end
return export