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

Contenu supprimé Contenu ajouté
Tentative d'amélioration
Tentative d'amélioration
Ligne 7 :
local taille = 1
if texte ~= nil then
repere = mw.ustring.find(texte,mod,1,true) -- Recherche la position du modèle
if tonumber(item) then
repere = mw.ustring.find(texte,"| "..item,repere,true) -- Dans le modèle recherche l'article indexé par un nombre
if repere then repere = repere+2 end
else
repere = mw.ustring.find(texte,item,repere,true) -- Dans le modèle recherche l'article
end
if repere then
taille = mw.ustring.find(texte,'\
',repere,true) -- Puis recherche le premier retour chariot qui suit
texte = mw.ustring.sub(texte,repere,taille-1) -- L'article est isolé
taille = taille - repere -- Calcul de la taille de l'article
repere = mw.ustring.find(texte,"=",1,true) -- Repère le =
repere = repere+1 -- Et regarde ce qu'il y a après
while mw.ustring.sub(texte,repere,repere) == " " do -- Cherche le début du paramètre