43 001
modifications
mAucun résumé des modifications |
(bugfix sur les remplacements auto d'identifiants) |
||
Ligne 43 : | Ligne 43 : | ||
local j = 1 | local j = 1 | ||
for replacing, replaced in pairs(replacement_ids) do | for replacing, replaced in pairs(replacement_ids) do | ||
if mw.ustring.find(pokemon_ids[i], replacing) | -- Les éléments entre parenthèses, notamment les liens, ne doivent pas être remplacés ; | ||
-- on ne remplace que ce qui est avant l'éventuelle première parenthèse | |||
if mw.ustring.find(pokemon_ids[i], replacing) and not(mw.ustring.find(pokemon_ids[i], "%(") and mw.ustring.find(pokemon_ids[i], replacing) > mw.ustring.find(pokemon_ids[i], "%(")) | |||
then pokemon_ids[i] = mw.ustring.gsub(pokemon_ids[i], replacing, "") .. " forme(" .. replaced .. ")" | then pokemon_ids[i] = mw.ustring.gsub(pokemon_ids[i], replacing, "") .. " forme(" .. replaced .. ")" | ||
end | end |