Module:Sortkey

From Sim Football Wiki
Revision as of 11:25, 16 July 2018 by 37thchamber (talk | contribs) (1 revision imported)
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Jump to navigation Jump to search

local getArgs = require('Module:Arguments').getArgs

local p = {}

function p._encode(sortkey) -- Protect against sortkey nesting. -- Example: Template:Sort if string.find(sortkey, "sortkey") or string.find(sortkey, "data-sort-value") then return ""; end

   return mw.text.encode(sortkey)

end

function p.encode(frame) local args = getArgs(frame); return p._encode(args[1] or "") end

return p