Module:Infobox body of water tracking/sandbox explained
local p =
function p.tracking(frame) local function isblank(val) return (val
nil) or val:match('^[%s]*$') end local function hasnoconvert(val) local res = nil val = mw.text.killMarkers(val) if val:match('[0-9]') then res = 1 if val:match('[%(][−0-9%.]') and val:match('[%)]') then res = nil end end return res end local cats = local maincats = local args = frame:getParent.args local AZ = 'ABCDEFGHIJKLMNOPQRSTUVWXYZ' local warnmsg = if isblank(args['image']) then maincats = maincats .. '' elseif isblank(args['alt']) then maincats = maincats .. '' end if isblank(args['coords']) and isblank(args['coordinates']) then maincats = maincats .. '' end if (isblank(args['pushpin_map'])) then maincats = maincats .. '' elseif isblank(args['pushpin_map_alt']) then maincats = maincats .. '' end if (isblank(args['image_bathymetry'])) then maincats = maincats .. '' elseif isblank(args['alt_bathymetry']) then maincats = maincats .. '' end local duplicate_parameters = 0 local duplicate_list = for i, params in ipairs(duplicate_list) do if args[params[1]] and args[params[2]] then duplicate_parameters = duplicate_parameters + 1 table.insert(warnmsg, 'Cannot use ' .. params[1] .. '
and ' .. params[2] .. '
at the same time.') end end if (duplicate_parameters > 0) then cats = cats .. '' end local no_convert_parameters = 0 local dim_list = for i, param in ipairs(dim_list) do if hasnoconvert(args[param] or ) then no_convert_parameters = no_convert_parameters + 1 table.insert(warnmsg, 'Unconverted dimensions in ' .. param .. '
') end end if (no_convert_parameters > 0) then maincats = maincats .. '' end if #warnmsg > 0 then if frame:preprocess("")
"" then cats = '
Infobox body of water warning: ' .. table.concat(warnmsg, '
') .. '
' .. cats end end
if maincats ~= and mw.title.getCurrentTitle.namespace