Module:Sandbox/BrownHairedGirl/valueFunc

This is an old revision of this page, as edited by BrownHairedGirl (talk | contribs) at 19:06, 31 March 2018 (simplify for testing). The present address (URL) is a permanent link to this revision, which may differ significantly from the current revision.
local getArgs = require('Module:Arguments').getArgs
local p = {}

local args = getArgs(frame, {
		valueFunc = function (key, value)
			if (value == nil) then
				value = '' -- nil value = blank
			end
			-- value = mw.ustring.gsub(value, "^%s+$", "") -- only whitespace, so replace with ''
			if (key == 3) then
				value = mw.text.trim(value:lower())
			end
			return value
		end
		})

		

function p.main(args)

	return  "args[1] = [" .. args[1] .. "]\n" .. "args[2] = [" .. args[2] .. "]" .. "args[3] = [" .. args[3] .. "]"


end

return p