require('strict')local p = local args, hasError
local function check(sources, targets) local source for _, param in ipairs(sources) do if args[param] and args[param] ~= then source = param break end end if not source then return nil end for link in mw.ustring.gmatch(args[source], '%[%[[^%[%]]+%]%]') do local name = mw.ustring.match(link, '([^%|]+)%]%]$', 3) for _, param in ipairs(targets) do if args[param] and args[param] ~= and mw.ustring.find(args[param], '%f[%w]' .. name .. '%f[%W]') then mw.log('The link "' .. link .. '" in |' .. source .. '= should be moved to |' .. param .. '=.') hasError = true break end end endend
function p.main(frame) args = frame:getParent.args check check if hasError and mw.title.getCurrentTitle.namespace
return p