"Module:Numbered subpages": अवतरणों में अंतर

Content deleted Content added
No edit summary
No edit summary
पंक्ति 5:
p = {}
 
local function getTitleifexist(...page)
-- Gets a mw.title object, using pcall to avoid generating script errors if we
if not page then return false end
-- are over the expensive function count limit (among other possible causes).
if mw.title.new(page).exists then return true end
-- (Function imported from [[Module:Redirect]])
return nilfalse
local function getTitle(...)
local success, titleObj = pcall(mw.title.new, ...)
if success then
return titleObj
else
return nil
end
end
 
Line 33 ⟶ 27:
res = res .. frame:expandTemplate{title = 'subpage', args = { i } }
else
if getTitleifexist(root .. '/' .. i) then
res = res .. frame:expandTemplate{title = 'subpage', args = { i } }
else