Difference between revisions of "Module:Common"

Jump to navigation Jump to search
no edit summary
Line 32: Line 32:
mw.log(title)
mw.log(title)
local disambig = string.find(title, '%(')
local disambig = string.find(title, '%(')
if string.sub(title, string.len(title)) == '%)' then
if disambig then
local check = disambig
title = title:gsub('(.*)%(.-%)', '%1')
while check do
local check = string.find(title, '%(', check + 1)
if check ~= 0 then
disambig = check
end
end
end
end
title = string.sub(title, 1, disambig)
return title
return title
end
end

Navigation menu