Difference between revisions of "Module:Format link"

88 bytes added ,  13:37, 4 October 2022
Avoid Lua erroring when we run out of expensive parser function calls
m (1 revision imported: Content from Template:Reflist on Wikipedia)
(Avoid Lua erroring when we run out of expensive parser function calls)
Line 168: Line 168:
local title = nil
local title = nil
if parsed.page then title = mw.title.new(parsed.page) end
if parsed.page then title = mw.title.new(parsed.page) end
if title and (not title.isExternal) and (not title.exists) then
if title and (not title.isExternal) then
category = mw.ustring.format('[[Category:%s]]', catMissing)
local success, exists = pcall(function() return title.exists end)
if success and not exists then
category = mw.ustring.format('[[Category:%s]]', catMissing)
end
end
end
end
end
Anonymous user