Modul:Hatnote list: Unterschied zwischen den Versionen
Simplified a few things, mostly re: calls to mw.listToText().
K (Derped on that comment fix before. Removed more incorrect/obsolete comment text.) |
(Simplified a few things, mostly re: calls to mw.listToText().) |
||
| Zeile 13: | Zeile 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 | ||
| Zeile 104: | Zeile 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 | ||