Content deleted Content added
Trialpears (talk | contribs) Add tracking category Category:Usage of portal image for non-existent portal |
add tracking category for default image |
||
Line 274:
end
function p._image(portal,
-- Wrapper function to allow getImageName() to be accessed through #invoke.
-- backward compatibility: if table passed, take first element
Line 281:
end
local name = getImageName(portal)
-- If
local
local args = mw.text.split(name, "|", true)
local result = {args[1]} -- the filename always comes first
local category = ''
-- parse name, looking for category arguments
for i = 2,#args do
local m = mw.ustring.match(args[i], "^%s*category%s*=%s*(.+)")
if m then
category = category .. m
elseif keepargs then
table.insert(result, args[i])
end
end
-- Temporary tracking category to clear out deleted portals
local portalTitle = mw.title.new(portal,"Portal")
if portalTitle and not portalTitle.exists then
end
-- reassemble arguments
result = table.concat(result,"|")
-- reappend categories
if #category > 0 then
result = result .. "|category=" .. category
end
return result
|