Module:Sandbox/BrownHairedGirl/valueFunc: Difference between revisions

Content deleted Content added
Reverted to revision 833470168 by BrownHairedGirl (talk): Rv updates meant to be on another page. (TW)
Tags: Replaced Undo
"%%%1"
 
(One intermediate revision by the same user not shown)
Line 2:
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)
s = "South Dublin (county)"
pn = "Category:Sportspeople from South Dublin (county)"
-- s = mw.ustring.gsub( s, "([^%w_])", "%%1")
s = mw.ustring.gsub( s, "([%W])", "%%%1")
 
pn = mw.ustring.gsub(pn, s, "")
 
 
 
 
return "args[1] s= [" .. args[1]s .. "]\n" .. "args[2]pn = [" .. args[2] .. "]" .. "args[3] = [" .. args[3]pn .. "]"