Module:Hatnote list: Difference between revisions
Jump to navigation
Jump to search
Simplified a few things, mostly re: calls to mw.listToText().
>Nihiltres m (Derped on that comment fix before. Removed more incorrect/obsolete comment text.) |
>Nihiltres (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 ') | |||
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 ') | |||
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 | ||
return p | return p |