Module:If empty

Permanently protected module
From Meta, a Wikimedia project coordination wiki
This is an archived version of this page, as edited by Robertsky (talk | contribs) at 04:46, 14 June 2023 (fixing reliance on this module on the other template.). It may differ significantly from the current version.
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Module documentation
local p = {}

function p.main(frame)
	local args = require('Module:Arguments').getArgs(frame, {wrappers = { 'Template:Ifempty', 'Template:If empty'}, removeBlanks = false})

	local lastk = 0
	for k,v in ipairs(args) do
		if v ~= '' then
			return v
		end
		lastk = k
	end

end

return p