Jump to content

Module:Sorted plain list

From Wikipedia, the free encyclopedia
This is an old revision of this page, as edited by Frietjes (talk | contribs) at 23:12, 11 April 2016 (testing). The present address (URL) is a permanent link to this revision, which may differ significantly from the current revision.
(diff) ← Previous revision | Latest revision (diff) | Newer revision → (diff)

local p = {}

function p.asc(frame)
    items = mw.text.split( frame.args[1] or '', ',%s*', true)
    table.sort( items )
    return '<div class="plainlist"><ul><li>' .. table.concat( items, "</li><li>" ) .. '</li></ul></div>'
end

function revComp( a, b )
    return a > b
end

return p