Jump to content

Module:Sortkey

Manlapud Wikipedia
Revision as of 16:39, 12 Setyembre 2018 by Lam-ang (tongtongan | saray entolong to) (copied from Module:Sortkey/847826635)
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Dokumentasyon na modulo[palsaen]
local getArgs = require('Module:Arguments').getArgs

local p = {}

function p._encode(sortkey)
	-- Protect against sortkey nesting.
	-- Example: {{sort|{{dts|2013|07|07}}|{{dts|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