« Module:Maintenance » : différence entre les versions

Contenu supprimé Contenu ajouté
rédaction
rédaction
Ligne 54 :
 
function ronge(param)
param = mw.ustring.sub(param,6) -- Élimine le suffixe
local rep = 1
local ex = true
while (mw.ustring.sub(param,rep,rep) ~= "/") and (mw.ustring.sub(param,rep,rep) ~= "|") and (mw.ustring.sub(param,rep,rep) ~= "]") do -- Cherche la fin du nom de la sous-page
rep = mw.ustring.find(param,"Sommaire",1,true)
rep = rep+1
if rep then
ex = false
end
ifrep = (mw.ustring.subfind(param,rep,rep) == "]sommaire",1,true) then
if rep then
ex = false
categorie = categorie.."[[Catégorie:Pages avec erreur dans un lien]] "
end
rep = 1
return mw.ustring.sub(param,1,rep - 1) --Isole le nom de la sous-page
if ex then
param = mw.ustring.sub(param,6) -- Élimine le suffixe
while (mw.ustring.sub(param,rep,rep) ~= "/") and (mw.ustring.sub(param,rep,rep) ~= "|") and (mw.ustring.sub(param,rep,rep) ~= "]") do -- Cherche la fin du nom de la sous-page
rep = rep+1
end
if (mw.ustring.sub(param,rep,rep) == "]") then
categorie = categorie.."[[Catégorie:Pages avec erreur dans un lien]] "
end
return mw.ustring.sub(param,1,rep - 1) --Isole le nom de la sous-page
else
return "Sommaire"
end
end