Module:Hatnote list: Difference between revisions
Content added Content deleted
m (Derped on that comment fix before. Removed more incorrect/obsolete comment text.) |
(Simplified a few things, mostly re: calls to mw.listToText().) |
||
Line 13: | Line 13: | ||
local p = {} |
local p = {} |
||
function p.andList ( |
function p.andList (list) |
||
-- Stringifies a list with "and" |
-- Stringifies a list with "and" |
||
return mw.text.listToText(list, nil, (#list > 2 and ',' or '') .. ' and ') |
|||
mw.text.listToText(andTable) |
|||
return andString |
|||
end |
end |
||
function p.orList ( |
function p.orList (list) |
||
-- Stringifies a list with "or" |
-- Stringifies a list with "or" |
||
return mw.text.listToText(list, nil, (#list > 2 and ',' or '') .. ' or ') |
|||
mw.text.listToText(andTable, nil, ' or ') |
|||
return orString |
|||
end |
end |
||
Line 104: | Line 100: | ||
table.insert(strList, string.format(options.forseeForm, useStr, pagesStr)) |
table.insert(strList, string.format(options.forseeForm, useStr, pagesStr)) |
||
end |
end |
||
return |
return table.concat(strList, ' ') |
||
end |
end |
||