Module:If empty

From Wikidata
Jump to navigation Jump to search
Lua
CodeDiscussionLinksLink count SubpagesDocumentationTestsResultsSandboxLive code All modules

Code

--
-- This module implements {{If empty}}
--
-- This is an improved version from cawiki, previously copied from enwiki version [https://ca.wikipedia.org/w/index.php?title=Module:If_empty&oldid=20680566 >> 12-jan-2019]
local p = {}
function p.main(frame)
	local args = require('Module:Arguments').getArgs(frame, {wrappers = 'Template:If empty', removeBlanks = false})

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

return p