Différences entre les versions de « Module:Common »

Aller à la navigation Aller à la recherche
125 octets ajoutés ,  11 août 2022 à 16:56
aucun résumé de modification
Ligne 25 : Ligne 25 :
end
end


function com.pagename(frame)
function com.modulePagename(title)
local args = a.getArgs(frame)
local title = args['title']
if not title then
if not title then
title = mw.title.getCurrentTitle()
title = mw.title.getCurrentTitle()
Ligne 33 : Ligne 31 :
local disambig = string.find(title, '%(')
local disambig = string.find(title, '%(')
local check = disambig
if string.sub(title, string.length(title)) == '%)' then
while check do
local check = disambig
local check = string.find(title, '%(', check + 1)
while check do
if check ~= 0 then
local check = string.find(title, '%(', check + 1)
disambig = check
if check ~= 0 then
disambig = check
end
end
end
end
end
title = string.sub(title, 1, check)
title = string.sub(title, 1, disambig)
return title
return title
end
function com.pagename(frame)
local args = a.getArgs(frame)
return com.modulePagename(args['title'])
end
end


return com
return com
1 124

modifications

Menu de navigation