Модуль:Ifempty

Реализует {{ifempty}}.


local p = {}
local getArgs = require('Module:Arguments').getArgs

function p.main(frame)
	local args = getArgs(frame, {removeBlanks = false})
	local before = args['до']
	local after = args['после']
	for i, v in ipairs(args) do
		if v ~= '' then
			return (before or '') .. v .. (after or '')
		end
	end
end

return p