local p =
local function check(args, 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 local warnings = 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] ~= then local match = mw.ustring.match(args[param], '.?.?%f[%w]' .. name .. '%f[%W]') -- Eliminate duplicate links if match and not mw.ustring.find(match, '^%' .. source .. '= should be moved to |' .. param .. '=
.') break end end end end return warningsend
function p.main(frame) local args = frame:getParent.args local warnings = check(args,,) or local warnings2 = check(args,,) or for _, v in ipairs(warnings2) do table.insert(warnings, v) end if #warnings ~= 0 then local ret = require('Module:If preview')._warning local namespace = mw.title.getCurrentTitle.namespace if namespace
118 then ret = ret .. '' end return ret endend
return p