Module:Sortkey

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

local p = {}

function p._encode(sortkey) -- Protect against sortkey nesting. -- Example: 1990-12-01 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